-
Notifications
You must be signed in to change notification settings - Fork 1.9k
no valid 'aps-environment' #1408
Comments
Update to 1.9.x - that fixes it |
@clearminds , 1.9x says it requires >= 6.4.0 which it doesn't seem that @js12690 has. @js12690 I wonder if you are using Meteor because of the specific version you have. If so, what did you end up doing in order to get it to work? I am in a similar boat |
@js12690 this got me to the next step, may have been xcode related or an issue with my entitlements file |
also, you might want to do a quick double check of your certs. I recommend using https://github.com/noodlewerk/NWPusher to make sure everything is setup properly on that end |
Same problem here: "no valid 'aps-environment' entitlement string found for application". But I won't be able to upgrade my cordova, so I can't upgrade to 1.9.1.... Any other ideas? I tried branching a version with the aps-enviironment configs in the plugin.xml, but that seems to do nothing. Thanks for thinking with me. |
I'm experiencing the exact same problem in a very strange set of circumstances: It started since I upgraded the plugin to the latest version, as well as Cordova to 6.4.0, and attempted to build on PhoneGap Build. I then read that 1.9+ was not supported on PGB, so I reverted back to 1.8.4, but it wouldn't work even after reverting. I don't understand what the problem could be. It's been working for months on plugin v1.8.4 and Cordova 6.3.1, just upgrading then downgrading back to the exact same version numbers again killed it. A full source-code rollback (with all plugins being tracked by version control) followed by rebuild didn't work, nor did recreating the provisioning profile in Apple's developer portal. |
edit: Spoke too soon. It looked like it was working (error message was gone) but push notifications do not arrive. |
@timeseriesBH did you try my fix? I was having the same issue and that's what fixed it for me |
I would try, but I am generating the app through a service (OutSystems), so I don't use Xcode... |
Same problem here. We should be updating some minor issues to our application, but this is preventing us to do it. |
Same problem; we use PGB, the entitlement is in the provisioning profile (also tried regenerating it) but we get "no valid 'aps-environment' entitlement string found for application" at registration. Is there a solution or is it possible to port the fix to 1.8.x? |
As far as I can see in the changelog, version 1.9.0 of the push plugin added aps-environment to *-Release.plist and *-Debug.plist. I updated my config.xml to include these lines but this didn't help (I am getting the error message). Is there anything I am still missing? Maybe, we can find a way to "port" the necessary changes of 1.9.0 into the config.xml? My attempt was: <config-file platform="ios" target="*-Release.plist" parent="aps-environment">
<string>production</string>
</config-file>
<config-file platform="ios" target="*-Debug.plist" parent="aps-environment">
<string>development</string>
</config-file> So I think I am still missing something. But maybe, this isn't as easy as I initially thought... |
@MBuchalik; saw that too and also tried that change and a few different variations on the target attribute in the config.xml but also haven't been able to get it to work. |
I confirm that the solution suggested by @MBuchalik does not fix the issue. |
<plugin name="phonegap-plugin-push" source="npm" spec="https://github.com/tonijn/phonegap-plugin-push#fix-aps-environment">
<param name="SENDER_ID" value="99999"/> <!-- pgb -->
<variable name="SENDER_ID" value="99999"/> <!-- cordova -->
</plugin>
Not working. PR cancelled |
Just did a PGB build and that seems to fix the problem. Thank you! |
@js12690 - Working for me. Builds on PGB with that tag and instead of the aps-environment error getting a success callback from the init() call. Also, successfully getting push notifications. |
@js12690, yes I used the solution given by @tonijn (should have specified that). The version of plugin-push is the branched 1.8.4. I am using PhoneGapBuild set to cli-6.4.0; this would fail to build on 1.9.x because the actual phonegap version was 6.3.x according to the logs. In my build log file is: My test device is iOS 10.1.1 and I am getting a device token. |
@rgagne - Thanks for your reply Just confirm with you. My code is following. Please correct me if i am wrong
|
@tonijn @rgagne @macdonst - I think there is some issue in PGB because week ago i have created one build that give me device token but now with same code i am trying to create build is not working for me. my code is same but before week it is work and now it is not. i have both ipa file (one is created week ago and second one is create yesterday). I am getting device token from one week ago file but unfortunately not get from file that created yesterday. can you please check on it? Thanks |
@js12690 fyi - my build also was working a week ago (roughly) and stopped working. I think something changed at Apple so that the aps-environment is required in the entitlements file. When I uploaded through iTunesConnect I'd get a warning (not an error) from Apple, but registration stopped working. With the 1.8.4 branch that @tonijn created it started working again - looks like the fix is a change in the plugin's config file to add the correct entitlement string. |
@js12690 - to answer your question above about your code; spec and version do the same thing; not sure what the behavior is if you have both
|
My version is working now in Debug and Release. I customised the 1.8.3. |
Hello all I am using following code
I think there is some problem in PGB. if i am wrong then please guys test your app and let me know if you still got issue Thanks in advanced |
Okay I think this is the fix for building with PGB. It works for us. <engine name="cordova" version=">=6.4.0"/>
<engine name="cordova-ios" version="~4.3.0"/>
<plugin name="phonegap-plugin-push" source="npm" spec="https://github.com/frederikbosch/phonegap-plugin-push#fix-aps-environment">
<param name="SENDER_ID" value="99999"/> <!-- pgb -->
<variable name="SENDER_ID" value="99999"/> <!-- cordova -->
</plugin> So you need cordova cli 6.4.0, cordova ios and 4.3.0 and the fix from PR #1469. And then you can get push working with Phonegap Build. |
The new branch provided by @frederikbosch is also working for me. |
@js12690 can you try 1.9.x on PGB now? I believe the issue on the build server has been resolved. |
My phonegap build is still not working with 1.9.2. While I do use 6.4.0 in the config xml and see that this is used on the phonegap build page.
|
I get this same error "no valid 'aps-environment' entitlement string found for application" - I am using cordova 6.4.0 and phongeap-plugin-push 1.9.2 I am not familiar with PGB and so I don't believe am using that. My platform/ios/.entitlements file has the aps-environment entry
The plugin.xml file has the changes from 1469 commit
This was all working fine at one point and then something changed which started giving this error - part of what changed was the renewal of my Apple dev account and I had to rebuild my provisioning profiles. I have spent quite some time reading through articles trying to figure this out but don't quite understand how to resolve this. Appreciate any help and pointers. Thanks. |
For xcode8+ you have to manually add aps-environment entitlement to the entitlements file. Some plugins (namely phonegap-plugin-push v1.9.0+) already do it automatically. There is also a second problem, the entitlement files can get conflicted. I suggest you to view the entitlement file location in your ios project. It should be Entitlements-Release.plist and Entitlements-Debug.plist. There are some plugins that can create their own entitlement files, and then ios starts to use them by default which then ignores the "real" entitlement files. There's also a conflict with the custom-config-file plugin You can read more about here: nordnet/cordova-universal-links-plugin#8 BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution#299 |
I have a "before_compile" hook that fixes this for me. It just reads and overwrites the entitlements file.
|
@ccorcos , thanks for giving a right direction to this error because none of the solution mentioned worked for me. I tried creating a hook using your code but that doesn't make any change in entitlement file. Then I manually made the change (adding aps-environment key) in entitlement file then also I got same "no valid aps-env" error. At last when I manually made change in Entitlements-Debug.plist file then it worked. Now I need to figure out how to update this plist file using hook. Please Let me know if you made any change in your hook code after posting code snippet here. Or share if you have any other suggestion. |
I am using plugin version of push notification (1.8.4) and create build using phonegap build with cli 6.3.0. Build created successfully but when test application on IOS 10.1.1 got following error message
no valid 'aps-environment' entitlement string found for application
I am using following code. Please help me as soon as possible
var push = PushNotification.init({
android: {
senderID: "12345679"
},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
},
ios: {
alert: "true",
badge: "true",
sound: "true"
},
windows: {}
});
push.on('registration', function(data) {
alert(data.registrationId);
});
push.on('notification', function(data) {
// data.message,
// data.title,
// data.count,
// data.sound,
// data.image,
// data.additionalData
});
push.on('error', function(e) {
// e.message
});
The text was updated successfully, but these errors were encountered: