(solved) Not receiving Push when using Apple Production Certificate

Is anyone having problem to receive Push when using the Production Certificate?

My app was just published on the App Store. I updated my Push Certificate to the Production one and downloaded my app from the store, but I am not receiving any push.

On the GT Message Panel, the message appears as  “Delivered”. Someone has any advice on what to do?

Hey Renato. What’s your app’s name in the store? I’ll take a look and see if I can find the problem.

Hi George.

Thanks for the quick reply.

The app is: 

https://itunes.apple.com/us/app/guarana-jesus-no-sao-joao/id882846974?mt=8&ign-mpt=uo%3D4

Ah, just looked here and it appears that something is missing:

Jun 2 22:43:43 Renatos-iPhone SpringBoard[33] \<Warning\>: No valid 'aps-environment' entitlement string found for application 'Guaraná Jesus': (null). Notifications will not be delivered. Jun 2 22:43:43 Renatos-iPhone GuaranaJesus[13161] \<Warning\>: AppDelegate.mm: didFailToRegisterForRemoteNotificationsWithError: no valid 'aps-environment' entitlement string found for application Jun 2 22:43:43 Renatos-iPhone GuaranaJesus[13161] \<Warning\>: Runtime error /Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin\_GameThrivePushNotifications.lua:292: attempt to concatenate field 'token' (a nil value) stack traceback: /Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin\_GameThrivePushNotifications.lua:292: in function \</Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin\_GameThrivePushNotifications.lua:270\> ?: in function \<?:218\>

I just need to find out what is that  ‘aps-environment’ that is missing…

UPDATE: Ok. It appears that that error is when the provisioning profile doesn’t have the Push permission (Although I already added it.). I will recreate it anyway.

Thanks for pasting the log, I was about to take a look at it myself.

This error usually means that the provisioning profile that the app was built with didn’t have push notification permissions on it at the time. The steps for adding push notification permissions to your provisioning profile are explained here under step “4. Provisioning Profiles”: http://docs.gamethrive.com/article/7-ios-push-certificate

After following those steps, make sure to re-import your provisioning profiles in xcode by following the directions under “Refresh Provisioning Profiles in Xcode” on this page: then restart Corona if it’s running. 

Ok. I confirmed it.

It appears that if you add a Push Permission to your App ID after you have created your Provision Profile, you need to recreate the Provision Profile (otherwise, it will not contain the Push permission).

So, my app went to the store without the Production Push permission.

Thanks George.

Yes, sorry about that :(. We’ll see if we can find a way to make these steps more clear.

You can also double check to see if your provisioning profile has push enabled by opening the .mobileprovision file as a text file, and looking for the following lines:

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

Hey Renato. What’s your app’s name in the store? I’ll take a look and see if I can find the problem.

Hi George.

Thanks for the quick reply.

The app is: 

https://itunes.apple.com/us/app/guarana-jesus-no-sao-joao/id882846974?mt=8&ign-mpt=uo%3D4

Ah, just looked here and it appears that something is missing:

Jun 2 22:43:43 Renatos-iPhone SpringBoard[33] \<Warning\>: No valid 'aps-environment' entitlement string found for application 'Guaraná Jesus': (null). Notifications will not be delivered. Jun 2 22:43:43 Renatos-iPhone GuaranaJesus[13161] \<Warning\>: AppDelegate.mm: didFailToRegisterForRemoteNotificationsWithError: no valid 'aps-environment' entitlement string found for application Jun 2 22:43:43 Renatos-iPhone GuaranaJesus[13161] \<Warning\>: Runtime error /Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin\_GameThrivePushNotifications.lua:292: attempt to concatenate field 'token' (a nil value) stack traceback: /Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin\_GameThrivePushNotifications.lua:292: in function \</Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin\_GameThrivePushNotifications.lua:270\> ?: in function \<?:218\>

I just need to find out what is that  ‘aps-environment’ that is missing…

UPDATE: Ok. It appears that that error is when the provisioning profile doesn’t have the Push permission (Although I already added it.). I will recreate it anyway.

Thanks for pasting the log, I was about to take a look at it myself.

This error usually means that the provisioning profile that the app was built with didn’t have push notification permissions on it at the time. The steps for adding push notification permissions to your provisioning profile are explained here under step “4. Provisioning Profiles”: http://docs.gamethrive.com/article/7-ios-push-certificate

After following those steps, make sure to re-import your provisioning profiles in xcode by following the directions under “Refresh Provisioning Profiles in Xcode” on this page: then restart Corona if it’s running. 

Ok. I confirmed it.

It appears that if you add a Push Permission to your App ID after you have created your Provision Profile, you need to recreate the Provision Profile (otherwise, it will not contain the Push permission).

So, my app went to the store without the Production Push permission.

Thanks George.

Yes, sorry about that :(. We’ll see if we can find a way to make these steps more clear.

You can also double check to see if your provisioning profile has push enabled by opening the .mobileprovision file as a text file, and looking for the following lines:

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