Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Register fail iOS 10. #1154

Closed
samuelfaj opened this issue Aug 10, 2016 · 38 comments
Closed

Register fail iOS 10. #1154

samuelfaj opened this issue Aug 10, 2016 · 38 comments
Assignees
Milestone

Comments

@samuelfaj
Copy link

It's working fine on iOS 9, but when i test on iOS 10 (beta) it doesn't work.

Reproduce Scenario (including but not limited to)

2016-08-10 12:25:31.658087 XXXXX[299:12855] Push Plugin register called
2016-08-10 12:25:31.658230 XXXXX[299:12855] PushPlugin.register: setting badge to false
2016-08-10 12:25:31.658259 XXXXX[299:12855] PushPlugin.register: clear badge is set to 0
2016-08-10 12:25:31.658277 XXXXX[299:12855] PushPlugin.register: better button setup
2016-08-10 12:25:31.658393 XXXXX[299:12855] GCM Sender ID (null)
2016-08-10 12:25:31.658413 XXXXX[299:12855] Using APNS Notification
2016-08-10 12:25:31.665839 XXXXX[299:11181] Push Plugin register failed

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS10

I think it needs to be known because iOS 10 is coming...

@macdonst
Copy link
Member

@samukt what version of the iOS 10 beta do you have installed? I tested this before vacation and it was working okay.

@samuelfaj
Copy link
Author

samuelfaj commented Aug 11, 2016

iOS 10 (beta 4)

I'm using the same version of the app (production in app store) in both versions of iOS.
In 9 it's working with no problems. In 10 the register is failing on register.

@macdonst
Copy link
Member

@samukt is your iOS 10 app in production? Make sure you are signing the iOS 10 app with the correct certificate. You might be signing with production and talking to development APNS server or vice versa.

@samuelfaj
Copy link
Author

samuelfaj commented Aug 11, 2016

Found it!

Not sure if it's new or doesn't needed in Xcode 7.
Xcode 8 now have option:

  • Add the Push Notifications entitlement to your entitlements file.

In Capabilities of the project, is jut click on fix to work.

captura de tela 2016-08-10 as 23 24 51

@jacquesdev
Copy link
Contributor

jacquesdev commented Aug 22, 2016

@samukt - what version of the phonegap-plugin-push version are you using? PS, thank you that worked!

@macdonst macdonst added docs and removed retest labels Aug 22, 2016
@briananderson1222
Copy link

Curious if there are plans for this functionality to be generated with a newer version of this Push Plugin? It seems that enabling this capability may be a requirement for XCode 8 going forward

@jacquesdev
Copy link
Contributor

jacquesdev commented Sep 8, 2016

@briananderson1222 - I totally agree, it's going to be a pain if we need to manually do it. @macdonst - is there any chance of this?

@chaffeqa
Copy link

chaffeqa commented Sep 10, 2016

I can confirm this is a requirement for xcode8 and iOS10

So it looks like if you add to .entitlements:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>aps-environment</key>
    <string>development</string>
</dict>
</plist>

everything should be set for sandbox at least... will update this thread when i see the production one

@briananderson1222
Copy link

@macdonst Curious if this #902 might fix this issue by dynamically using the entitlements specified in the provisioning profile

@macdonst macdonst self-assigned this Sep 14, 2016
@macdonst
Copy link
Member

Looking into a solution now.

@macdonst
Copy link
Member

I talked to @shazron about this and we will need to make some changes in cordova-ios 4.3.0 in order to support the .entitlements file as we want to fix this not only for aps-environment but for other capabilities that may also be required going forward.

@shazron
Copy link
Member

shazron commented Sep 15, 2016

Watch this issue: https://issues.apache.org/jira/browse/CB-11854

@briananderson1222
Copy link

Thanks @macdonst @shazron .. any idea on timeline for a fix like that given that iOS 8 was released yesterday?

@jacquesdev
Copy link
Contributor

@macdonst and @shazron - is there any possibility of this update also being made for cordova-ios 3.9.2?

@jcesarmobile
Copy link
Collaborator

On my file picker plugin @EddyVerbruggen added a hook to write the .entitlements file, can't we just do that?

@briananderson1222
Copy link

@jcesarmobile something like that was my backup plan until we can see this fix come through. It'd be nice though if cordova supported this without needing this specific plugin to implement its own hook

@shazron
Copy link
Member

shazron commented Sep 15, 2016

Hooks are undesirable for cloud builders like PhoneGap Build, that can't run hooks

Sent a PR: apache/cordova-ios#256

@shazron
Copy link
Member

shazron commented Sep 16, 2016

PR merged in, should be in for the future cordova-ios 4.3.0 release. You can test this with the nightly platform released tonight at 8PM PDT.

@macdonst macdonst added this to the Release 1.9.0 milestone Sep 17, 2016
@macdonst
Copy link
Member

Assigning this issue to the 1.9.0 milestone as it will force users to take cordova-ios 4.3.0.

@psirenny
Copy link

Is upgrading to cordova 4.3.0 nightly enough or do we still need to manually enable the entitlement?

@briananderson1222
Copy link

@shazron what is the recommended way of adding properties to these entitlement files?

@shazron
Copy link
Member

shazron commented Sep 20, 2016

@briananderson1222 the plugin.xml should have something like

<config-file parent="aps-environment" target="*/Entitlements-Debug.plist">
          <string>development</string>
</config-file>

@Bart-Holland
Copy link

What if you are not in Debug, but in release:

<config-file parent="aps-environment" target="*/Entitlements-Release.plist">
          <string>???</string>
</config-file>

what should be entered in stead of ???

@manojbojja
Copy link

manojbojja commented Sep 27, 2016

Ios 10.0.8 (1.8.2 push plugin) not receiving notifications. After checking in xcode too. Registering is fine but push.on is not firing in any app state.

console.log(push) after device is registered for push notification.
{"_handlers":{"registration":[null],"notification":[],"error":[null]},"options":{"ios":{"alert":"true","badge":"true","sound":"true","clearBadge":"true"}}}

@jcesarmobile
Copy link
Collaborator

@Bart-Holland it's supposed to be production

@Bart-Holland
Copy link

@jcesarmobile Thanks doesn't seem to work for me though. Something else is not going well 🎱

@briananderson1222
Copy link

@Bart-Holland I believe you need to wait for Release 1.9.0 or a related PR (which I have not seen) as this is a change in the plugin.xml not the config.xml... I'm all ears if someone has a way of implementing this sooner without requiring a custom build

@PvanHengel
Copy link

PvanHengel commented Oct 2, 2016

Good morning, was able to get everything "working", you must use the nightly build of the cordova ios platform until they release 4.3, the latest version (4.2.1) does not work. You need that for a few reasons, for me its how i was able to get the team name and certs setup properly using the build.config file. Also there is a bug where notifications received when the app was running in background were not working. In addition to that you need to use the latest 1.8.2 of this, however as per the above, you need to manually modify the entitlements files, (debugger gets development key and release get production key) . We are using jenkins for CI so it was easy enough to plug in there, however for obvious reasons it should be a part of this plugin, when can we expect 1.9 release? I'm sure that there are many other things for xcode 8 / ios 10 that we want to add, but this is a severe bug, as all push notifications don't work after the upgrade, so its somewhat critical for me, and i'm sure many others.

@lucorn
Copy link

lucorn commented Oct 7, 2016

Is there any workaround for building Cordova apps from Visual Studio? Running my app on an ios10 device gives an error saying "no valid 'aps-environment' entitlement string found for application".

@kaynz
Copy link

kaynz commented Oct 13, 2016

@macdonst Maybe you should commit a big hint into the readme so that people see that the plugin is actually not working with iOS 10. They all investigate time to create bug reports with stack traces.

@kntmrkm
Copy link

kntmrkm commented Oct 20, 2016

iOS10 registration will fail until cordova-ios 4.3.0 and phonegap-plugin-push 1.9.0?

I confirmed that iOS9.3.5 works fine, but iOS10.0.2 got below error.

no valid 'aps-environment' entitlement string found for application.

Btw, below setting is temporary solution?

<config-file parent="aps-environment" target="*/Entitlements-Debug.plist">
          <string>development</string>
</config-file>

I tried that. but does not solve problem.
plugins/phonegap-plugin-push/plugin.xml is the file? right?

[edited]

I upgraded cordova-ios from 4.1.0 to 4.2.1.
Registration works well without no valid 'aps-environment' entitlement string found for application.

I don't know what is a problem...

@PvanHengel
Copy link

No it needs to go into the root of out output Xcode project not the cofig xml.

Sent from my iPhone

On Oct 20, 2016, at 12:58 AM, kenta murakami notifications@github.com wrote:

iOS10 registration will fail until cordova-ios 4.3.0 and phonegap-plugin-push 1.9.0?

I confirmed that iOS9.3.5 works fine, but iOS10.0.2 got below error.

no valid 'aps-environment' entitlement string found for application.

Btw, below setting is temporary solution?

development I tried that. but does not solve problem. plugins/phonegap-plugin-push/plugin.xml is the file? right?


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

@kylerjensen
Copy link

Hey guys, we need to remember to maintain support for both development and production aps environments:

<key>aps-environment</key>
<string>development</string>

versus

<key>aps-environment</key>
<string>production</string>

@bradleyjames
Copy link

Actually I don't believe you do. Xcode handles that for you.

http://stackoverflow.com/questions/39625258/xcode-8-aps-environment-entitlement-wont-set-to-production

@PvanHengel
Copy link

It does if you manually open and turn it on but since Cordova doesn't do that the build fails. Full automation can't be done without the file

Sent from my iPhone

On Oct 20, 2016, at 1:09 PM, Brad Reynolds notifications@github.com wrote:

Actually I don't believe you do. Xcode handles that for you.

http://stackoverflow.com/questions/39625258/xcode-8-aps-environment-entitlement-wont-set-to-production


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

@bradleyjames
Copy link

Sorry, I wasn't clear. My point was that this file doesn't need to be updated to a value of "production". The provisioning process handles that for you but it never updates the file on disk to say "production". But yes, the file does need to exist for the build.

@KapilPowar
Copy link

KapilPowar commented Nov 10, 2016

iOS 10 registration fails with cordova-ios 4.3.0 plugin. With older plugin 4.2.1 works fine.

ippeiukai pushed a commit to ippeiukai/phonegap-plugin-push that referenced this issue Feb 1, 2017
ippeiukai pushed a commit to ippeiukai/phonegap-plugin-push that referenced this issue Feb 1, 2017
@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests