[Question] Looking solution: Push notification when SaaS open API for customer build apps

Hi brothers,

My company has an model biz about SaaS product, we build open api for client build application. Now i have problems, I do not know how to load dynamic pushAdapter for our app and customer apps?

I mean each pushAdapder for each application (ios and android,…).

I just understand Parse only config pushAdapter when init app.

    const PushAdapter = require('@parse/push-adapter').default;
    const pushOptions = {
      ios: { /* iOS push options */ } ,
      android: { /* android push options */ }   
    }
    // starting 3.0.0
    const options = {
      appId: "****",
      masterKey: "****",
      push: {
        adapter: new PushAdapter(pushOptions),
      },
      /* ... */ 
    }

    const server = new ParseServer(options);

Hope brothers help me to suggest any solutions.

Many thanks,

I am not sure I understood your question, but the way you are already setting up push options (passing iOS and Android together) should work properly for both iOS and Android connected to the parse server at the same time.

I mean, push options only use for our application. But our company build open API for client who build other app.

I can not config for push noti to client apps.

image

I believe that for iOS something like this should fit your needs:

const pushOptions = {
      ios: [{ /* setup for app 1 */ }, { /* setup for app 2 */ }, { /* etc */ }]
    }

But it looks that same can’t be done to Android.

So, I see three options:

  • Test if it works for iOS and check what is the effort to send a PR and make it possible to Android as well;
  • Create your own custom Push Adapter to handle your use-case;
  • Spin up one parse server for each of your apps.

Thank you so much@davimacedo

Before post question, I think 2 options the same with you (option 2, 3).

I already built custom push adapter, but I think if we can load dynamic push adapter, it’s better.