phonegap/phonegap-plugin-push

Add ability for VoIP pushes on iOS

mark-veenstra opened this issue Β· 16 comments

On iOS it is possible to register for VoIP pushes: https://developer.apple.com/library/prerelease/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html

Could these VoIP pushes be added to the roadmap?

any update on this?

Hey guys,

have you made any headway with this yourselves?

Hey guys,

I ended up creating the plugin myself. You can get it on npm here.

You can install the plugin with:

ionic plugin add cordova-ios-voip-push

and then use the plugin like this in your Ionic/Cordova app:

var push = VoIPPushNotification.init();

push.on('registration', function(data) {
    log("[Ionic] registration callback called");
    log(data);

    //data.deviceToken;
    //do something with the device token (probably save it to your backend service)
});

push.on('notification', function(data) {
    log("[Ionic] notification callback called");
    log(data);

    // do something based on received data
});

push.on('error', function(e) {
    log(e);
});

There are some additional steps to take in Xcode, so please refer to the official plugin site to read the full tutorial.

As I've mentioned there, I'm mentioning here as well:

I don't 'do' ObjectiveC for a living (but I may change my mind after completing this :)), so I would really appreciate the constructive feedback in making this plugin better, and I look forward to your comments and potential pull requests!

Also, I'm going to ask you guys if you (after you go over the demo and tutorial) think this should be added as a PR to the Phonegap plugin push?

Thanks,
Nikola

gentle reminder

@Hitman666 that's cool man. Ever think of sending a PR to this plugin?

+1

Even tough #2194 was merged the feature does not seem fully supported. For example I can't find a way to get the device token when using VOIP push.

I opened this issue to track the question: #2442

If you are using FCM this will not work as the code paths are split, for some reason if voip is true, the token returned will not be from firebase bc we never run the code which receives it.

the code path is basically..

if (voip) {
register for voip }
else {
read google services plist and retrieve fcm token
}

i dont know enough to know whether or not this can be changed

We are using this plugin with VoIP push in production and it does fine. I think this issue can be closed...

along with FCM? Please provide details how you were able to use VOIP and FCM with this plugin. Last comment you made was that it wasnt working... the code path seems to suggest it is not possible..

Maybe I misunderstood the issue but we are using this plugin for VoIP push on iOS and also we use this plugin for fcm push on android. Is that what you meant @bpowell15

Happy to share some code if requested...

You are probably using APN directly?

Jep that is correct

Hi, does anybody know if there is a way to use this plugin to register for VoIP and FCM separately? (Meaning you would get one token for VoIP, for direct messages, etc, and another token for FCM for e.g. topic subscriptions). In this case, the server would be able to choose which token to use based on how urgent the update is.

GMK82 commented

Hi, does anybody know if there is a way to use this plugin to register for VoIP and FCM separately? (Meaning you would get one token for VoIP, for direct messages, etc, and another token for FCM for e.g. topic subscriptions). In this case, the server would be able to choose which token to use based on how urgent the update is.

did you find a way?