I am developing an iOS App with Push Notifications. I am able to successfully test the push notifications using the Developer APN Certificate but it does not work with the Production APN Certificate.
I have ensured that the profiles in the iOS Developer Portal (adhoc / distribution) are generated after Push Notification is enabled for the APP ID and have taken care to use the correct UA_KEY and UA_SECRET in AppDelegate.m.
Can anybody please provide insights on as to what could be the possible reason(s) why Push notifications are failing using Production Certificate but working fine with Development Certificate.
I finally seemed to have sorted this out and posting back here in hope that it may help.
The key point which helped me to identify the problem was to turn on 'Debugging' in the UA Console to see the details errors. (This was actually the suggestion provided by their support team)
Most probably you have figured that out by now. Anyway, I think the problem caused by not including your Production UA_Key and UA_Secret in your UAConfig file. It's better to follow up with the sample they provide in their Resources page as you can't go wrong with their sample.
I have an app in the store and push works for anyone having bought the app, no problem there.
But it does not work on the two phones we used for development.
How do we solve this?
tunebot for iphone
With regards to push notifications, you have two different servers with two different certificates for the notifications. One of those is a test/development server, which has one set of permissions. The other is a production server with a different set. If you go to the iOS Provisioning Portal and click on App IDs, you'll see that the second column has two rows, one for development PN and one for production. Start here and make sure your development ones are configured properly.
I am encountering this error when I am loading an Ad Hoc build of my Push Notification enabled iPhone app onto my device:
no valid aps-environment entitlement found for application
What does it mean, and how do I repair it?
I found the solution. In my project info under Build > Code Signing Identity I had it set to automatic, and it was selecting an AdHoc distribution profile which did not have push notifications enabled. (It was the wrong one.) I have selected the correct profile and the error is gone.
Push Notifications must be enabled for your App ID before creating a Provision Profile.
So, in this order:
Create your APP ID
Enable APNS
Create the Provisioning Profile
You have to enable Target—> capabilities—> push notification. I have faced this issue using Xcode 8.1.
In my case Xcode had invalidated the provisioning profile (it will say so in the Member Center).
What worked was to refresh all the provisioning profiles in Xcode after enabling Push for the app in the Member Center.
Here is Apples guide to refresh all the provisioning profiles on your computer. https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html#//apple_ref/doc/uid/TP40012582-CH30-SW26
In short open Xcode and do the following:
In the Xcode Preferences window, click Accounts.
Select your team, and click View Details.
In the dialog that appears, click the Refresh button in the
lower-left corner under the Provisioning Profiles table.
Xcode updates the list of profiles in the Provisioning Profiles table.
Generate a Provision Profile specific for your App ID (Push Notifications Enabled), do not use the widlcard ones
I kept going through the process over and over again with one mistake...
the Provisioning profile i kept on using was DEVELOPMENT this WILL NOT WORK
you NEED to use ADHOC provisioning profile
if you didn't write the original code and aren't 100% sure on how it works, make sure that you have it set up to receive the right type of push notification token. had a problem where the app i was working on was only set up tokens on a release build. it's worth a try if nothing else works and you think your code is set up properly -- find the steps online somewhere to do a ad-hoc build and try it
It'll work even with a development profile but if you add in APN (Apple Push Notifications) after the fact make sure to go into member center and open the provisioning profile again (my said invalid), just opening it and closing it made it valid again and then I updated my profiles in Xcode via settings and everything worked just fine.
In my case, I renamed the App. So the provisioning profile was generated for the old App-ID. All I had to do, was to change the App-ID and add an new provisioning profile with the new App-ID.
For IONIC USERS:-
CAUSE:- If you are running your app in iphone using "ionic run ios" then this will also cause the same problem.
SOLUTION:- instead you must run your ios app using XCODE to install app into iphone.
SOLVED MY PROBLEM!!!!
The iPhone i'm developing with (building the application to, not installed via ad-hoc) receives push notifications as it should. I've got an application that just sends dummy push notifications on command, and the dev iphone receives them consistently. However, I've distributed a beta build under the release configuration to several co-workers, and none of these builds of the app have received a single push notification. I've confirmed that the app prompts the user on first run for permission to receive push notifications, and I've also confirmed that everyone has answered "yes" to this prompt. Has anyone else experienced this problem? I feel like it has something to do with provisioning, but the apple developer portal is so vague about things, I very well could be missing something important.
Looks like I missed the part in apples push documentation where it states that apps distributed via ad-hoc use the apple production push gateway, not the apple dev push gateway. I was under the assumption that while developing the application, I always wanted to use the "development" push gateway...but that's what I get for using common sense.
I've recently started developing iphone applications for a project at school and I've been having some problems testing push notifications. I've read I need to get some SSL certificate from the program portal, but I cannot find the link AppID where I am supposed to get them. Is it really necesary even though I am just starting out making some tests in XCode? What else do I need to run push notifications?
I've started coding the client side, but I cannot register for remote notifications. (I run registerForRemoteNotificationTypes:..., but it cannot register) I think it is because I don´t have the certificates, but I really don´t know.
Thanks!!
you need to be enrolled in developer programe.you can not test push notification for free.