Skip to content
This repository was archived by the owner on Feb 7, 2019. It is now read-only.
This repository was 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

Description

@bnussey

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

Activity

  1. AntonDobrev commented on May 25, 2017

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

  2. bnussey commented on May 25, 2017

    @bnussey
    Author

    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.

  3. simonox commented on Jul 3, 2017

    @simonox

    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.

  4. simonox commented on Jul 5, 2017

    @simonox

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

  5. DavyDeDurpel commented on Oct 4, 2017

    @DavyDeDurpel

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

  6. diadal commented on Nov 30, 2018

    @diadal

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions