Skip to content

PushNotifcaitons not working when using different mountPaths #2853

Closed
@ConnorsApps

Description

@ConnorsApps

I am making a few apps that all connect to the same parse server here is the code I am using in the index.js.

var api = new ParseServer({
  databaseURI: databaseUri || 'MyUrl',
  cloud:  __dirname + '/cloud/main.js',
  appId: 'MyAppId',
  masterKey: 'MasterKey', //Add your master key here. Keep it secret!
  serverURL: 'http://app.elasticbeanstalk.com/parse',  // Don't forget to change to https if needed
 push: {
                          ios: {
                          pfx: 'Certificates.p12', // The filename of private key and certificate in PFX or PKCS12 format from disk
                          // cert: '', // If not using the .p12 format, the path to the certificate PEM to load from disk
                          // key: '', // If not using the .p12 format, the path to the private key PEM to load from disk
                          bundleId: 'com.3B.RestaurentApp', // The bundle identifier associate with your app
                          production: true // Specifies which environment to connect to: Production (if true) or Sandbox
                          }
                          },

                            // if the account lockout policy is set and there are more than `threshold` number of failed login attempts then the `login` api call returns error code `Parse.Error.OBJECT_NOT_FOUND` with error message `Your account is locked due to multiple failed login attempts. Please try again after <duration> minute(s)`. After `duration` minutes of no login attempts, the application will allow the user to try login again.
  accountLockout: {
    duration: 10, // duration policy setting determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. Set it to a value greater than 0 and less than 100000.
    threshold: 30, // threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. Set it to an integer value greater than 0 and less than 1000. 
  }


});
var apiApp2 = new ParseServer({
  databaseURI: databaseUri || 'DataBaseURL',
  cloud: __dirname + '/cloud/App2.js',
  appId: 'AppId',
  masterKey: 'MasterKey', //Add your master key here. Keep it secret!
  serverURL: 'http://App.elasticbeanstalk.com/App2',  // Don't forget to change to https if needed
 push: {
                          ios: {
                          pfx: 'Certificates2.p12', // The filename of private key and certificate in PFX or PKCS12 format from disk
                          // cert: '', // If not using the .p12 format, the path to the certificate PEM to load from disk
                          // key: '', // If not using the .p12 format, the path to the private key PEM to load from disk
                          bundleId: 'com.3B.App2', // The bundle identifier associate with your app
                          production: true // Specifies which environment to connect to: Production (if true) or Sandbox
                          }
                          },
                            // account lockout policy setting (OPTIONAL) - defaults to undefined
  // if the account lockout policy is set and there are more than `threshold` number of failed login attempts then the `login` api call returns error code `Parse.Error.OBJECT_NOT_FOUND` with error message `Your account is locked due to multiple failed login attempts. Please try again after <duration> minute(s)`. After `duration` minutes of no login attempts, the application will allow the user to try login again.
  accountLockout: {
    duration: 10, // duration policy setting determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. Set it to a value greater than 0 and less than 100000.
    threshold: 30, // threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. Set it to an integer value greater than 0 and less than 1000. 
  }
});
var apiSitAndStayCafe = new ParseServer({
  databaseURI: databaseUri || 'MongoUrl',
  cloud: __dirname + '/cloud/App3.js',
  appId: 'AppId',
  masterKey: 'MasterKey', //Add your master key here. Keep it secret!
  serverURL: 'http://App.elasticbeanstalk.com/App3',  // Don't forget to change to https if needed
 push: {
                          ios: {
                          pfx: 'App3', // The filename of private key and certificate in PFX or PKCS12 format from disk
                          // cert: '', // If not using the .p12 format, the path to the certificate PEM to load from disk
                          // key: '', // If not using the .p12 format, the path to the private key PEM to load from disk
                          bundleId: 'com.3B.App3', // The bundle identifier associate with your app
                          production: true // Specifies which environment to connect to: Production (if true) or Sandbox
                          }
                          },
                            // account lockout policy setting (OPTIONAL) - defaults to undefined
  // if the account lockout policy is set and there are more than `threshold` number of failed login attempts then the `login` api call returns error code `Parse.Error.OBJECT_NOT_FOUND` with error message `Your account is locked due to multiple failed login attempts. Please try again after <duration> minute(s)`. After `duration` minutes of no login attempts, the application will allow the user to try login again.
  accountLockout: {
    duration: 10, // duration policy setting determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. Set it to a value greater than 0 and less than 100000.
    threshold: 30, // threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. Set it to an integer value greater than 0 and less than 1000. 
  }
});
var mountPath = '/parse';
app.use(mountPath, api);

var mountPathApp2 = '/App2';
app.use(mountPathApp2, apiApp2);

var mountPathApp3 = '/App3';
app.use(mountPathApp3, apiApp3);

Everything works fine like calling cloud functions except push notifications. What is the correct way I should set these apps up with their own urls?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions