Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

iOS notifications wont work unless open xcode project and enable Push Notifications capability #123

Open
bnussey opened this issue May 20, 2017 · 6 comments
Labels

Comments

@bnussey
Copy link

bnussey commented May 20, 2017

Hello,

I've added everything to info.plist but to get notifications to work on iOS I still need to open xcode project and manually enable Push Notifications capability.. any ideas as to why I need to do this everytime? Thanks

@AntonDobrev
Copy link
Contributor

@bnussey Indeed, this may be of help to developers. I cannot test right now but I think that if the App Id in your Apple developer account is featuring this capability and you have the respective provisioning profile locally, you can build and deploy the app with this added capability.

On the other hand, if your rely on Xcode to make the build, run or deploy operation, you may need to enable the capability in there. So independent on the worfklow you need to add this capability.

Not sure if the process can be automated, but sounds worth checking.

@bnussey
Copy link
Author

bnussey commented May 25, 2017

Got ya @AntonDobrev so if I update my provisioning profile after enabling notifications then I shouldn't have to do this? I believe my provisioning profile was put in place before doing the notification work, so that could explain it. My research didnt find a way to automate it.. but will have another look and report back if thats the case.

@simonox
Copy link

simonox commented Jul 3, 2017

Same on my machine. I can turn on PushNotifications on iOS in Xcode's Capabilities tab and it works. It is not turned on if I prepare the Xcode project with tns prepare ios.

@simonox
Copy link

simonox commented Jul 5, 2017

I had to use the nativescript-custom-entitlements plugin to add the entitlement.

@DavyDeDurpel
Copy link

Having the same issue. Thanks simonox, for the tip, the custom entitlements plugin solution works like a charm.

@diadal
Copy link

diadal commented Nov 30, 2018

this may help someone

setTimeout(function() {
pushPlugin.register(iosSettings, function (data) {
    console.log("Device registered. Access token" + data);

    // Register the interactive settings
        if(iosSettings.interactiveSettings) {
            pushPlugin.registerUserNotificationSettings(function() {
                alert('Successfully registered for interactive push.');
            }, function(err) {
                alert('Error registering for interactive push: ' + JSON.stringify(err));
            });
        }
}, function() { });

},20000)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants