0
votes

Issue Description

My two apps (a free app and a pro app) point to the same parse database.

Expected Results

I want Push Notifications working in both two apps.

Actual Outcome

While for now, only one app can send push notification successfully.

Steps to reproduce

Besides sending notifications by my apps, I also tried to send push by dashboard. The result is same, only one app works, another fails to get the notification.

Environment Setup

I'm trying the way in Github #2188. I also refer to following two links: https://www.parse.com/questions/push-to-multiple-apps Multiple apps in a single parse server

But all didn't work.

Thanks so much for helping out.

My cloud code in index.js are:

  • { }push: { ios: [
    { pfx: __dirname+'/push_certs/DevPushLoveAgainPro.p12', // Dev PFX or P12 bundleId: 'com.app1', production: false // Dev },
    { pfx: __dirname+'/push_certs/ApplePushLoveAgainPro.p12', // Prod PFX or P12 bundleId: 'com.app1', production: true // Prod }, { pfx: __dirname+'/push_certs/DevPushLoveAgainFree.p12', // Prod PFX or P12 bundleId: 'com.app2', production: false // Prod },
    { pfx: __dirname+'/push_certs/ApplePushLoveAgainFree.p12', // Prod PFX or P12 bundleId: 'com.app2', production: true // Prod } ] }


    Parse.Cloud.define("push", function(request, response) { var id = request.params.toUser; getUser(id).then (
    function(user) {
    var query = new Parse.Query(Parse.Installation); query.equalTo("user", user); Parse.Push.send({ where: query, data: request.params.data }, { useMasterKey: true, success: function() { response.success('Success!!!!!!!!!!!'); }, error: function(error) { response.error('Error!!!!!!!!!!!!!! ' + error.message); } });

    }
    ,
    function(error)
    {
        response.error(error);
    }
    

    );});function getUser(userId){ var userQuery = new Parse.Query(Parse.User); userQuery.equalTo("objectId", userId); return userQuery.first ({ useMasterKey: true, success: function(userRetrieved) { return userRetrieved; }, error: function(error) { return error; } }); };

1
Did you check if the Installation collection (in parse-dashboard) contain entries of both bundle identifiers? - Ran Hassid
@RanHassid, thanks so much for replying. What do you mean by 'contain entries of both bundle identifiers' ? My two apps share the same parse db, and I can save data successfully. - Paradise
Under your installation collection you should see which app is registered.. there you need to make sure that both app are registered - Ran Hassid
@RanHassid, sorry, I'm using SaShiDo; I can see data from 2 apps in db with different appIdentifiers. - Paradise
So i think the issue is with your certificate.. - Ran Hassid

1 Answers

0
votes

So, at here, when we generate p12 files from KeyChain, we shouldn't involve the private key, even you don't add password. So just ignore the private key when generating p12 files.