phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

Add ability for VoIP pushes on iOS #728

Open mark-veenstra opened 8 years ago

mark-veenstra commented 8 years ago

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?

Mrugank93 commented 8 years ago

any update on this?

Hitman666 commented 8 years ago

Hey guys,

have you made any headway with this yourselves?

Hitman666 commented 8 years ago

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

FredeHo commented 7 years ago

gentle reminder

macdonst commented 7 years ago

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

jQrgen commented 6 years ago

+1

BorntraegerMarc commented 6 years ago

Even tough https://github.com/phonegap/phonegap-plugin-push/pull/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: https://github.com/phonegap/phonegap-plugin-push/issues/2442

bpowell15 commented 5 years ago

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

BorntraegerMarc commented 5 years ago

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

bpowell15 commented 5 years ago

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..

BorntraegerMarc commented 5 years ago

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...

bpowell15 commented 5 years ago

You are probably using APN directly?

BorntraegerMarc commented 5 years ago

Jep that is correct

kiontupper commented 5 years ago

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 5 years ago

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?

kiontupper commented 5 years ago

No instead I just ended up using one signal which can handle voip and fcm. But note with iOS 13 apps won’t be able to use voip without presenting a callkit ui.

On Jun 12, 2019, at 07:21, GMK82 notifications@github.com wrote:

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?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.