Not receiving push notifications when enterprise app is in production - ios

I have created an application on an enterprise account, since it's just going to be used by the employees in the company,
I have made the provisioning profiles and the certificates, while the app is still in development, I can receive push notifications normally, sandbox = 1, but when we added the app to the website, push notifications are not been received, knowing that the sandbox turned to 0.
Any idea what could be wrong?
Thank you

make sure that the certificate that you are using to send the notifications is attached to a "Distribution Provisioning Profile" and not "Development Provisioning Profile".
Got to iTunes Connect > Identifiers > App IDs, and make sure that your App ID Push Notifications are configured for Distribution. AND you are using the matching certificate when sending the notifications.

Related

Not Receiving iOS VoIP Notifications with In House Provisioning Profile

I'm trying to implement VoIP notifications into my app following this tutorial: http://pierremarcairoldi.com/ios-8-voip-notifications/
I'm making an app that will be distributed internally with an Apple Developer Enterprise program (in-house deployment).
I followed every step of the tutorial and I've tried to send notifications using a development provisioning profile. All works normally and I'm able to receive those notifications.
The problem is when I switch to an In-house provisioning profile. The app finishes to register the VoIP token with the server correctly, but when I send notifications through houston with the new token nothing happens, including the fact that the app doesn't enter in the pushRegistry:didReceiveIncomingPushWithPayload:forType: method.
Are there any limitations of this feature when using in-house profiles or am I doing something wrong?
Thanks in advance!

Create a certificate for app which is used APNS

I have a question on creating a certificate for submitting an app to the app store. In my app, i am using APNS. When creating a certificate, do i need to select only App Store and Ad Hoc or both App Store and Ad Hoc and Apple Push Notification service SSL(Production) under production section. Anyway when i am creating provisioning profile i am enabling push notifications.
For app store you can select only Apple Push Notification service SSL (Production).
You select only app Store. Add hoc distribution should use only for development phase.

How to know if there is a valid 'aps-environment' for an iOS app before submitting to itunesconnect

Each time I submit a testing application for push notifications to iTunesConnect I receive a mail saying that I should resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement.
I've been checking and testing with differents solutions proposed on SO, no one of them works yet, but my question is:
Is there a way to know if the build result has a valid aps-environment BEFORE submiting to itunesconnect?
Also, if I run from xCode on my plugged device, the notification works, but if I run it using a device that receive the app using testFlight, it doesnt works.
Reading the description of your problem, it seems that you have only configured the Push Notifications only for development and not for distribution of your App ID.
I am pretty sure that is the only issue causing this scenario. As apple is rejecting the binary that means your App settings confirm to Push Notifications, but the App ID is not configured to support it.
If your App ID is configured for both Development and Distribution, then on your developer account your App ID should 'enabled' against Push Notifications under both 'Development' and 'Distribution'

Not getting push notifications with ADHoc certificates

I am testing push notifications with production.pem with ADHoc provisioning certificates. From server side sending successfully but device is not getting notifications. Please help me
Thank you
The Server will show success means the problem is at your side, Check the below three scenarios for this
1.) The gateway should be gateway.push.apple.com:2195
2.) You have refreshed your provisioning profile after creating APNS certificate
3.)Your Device Token is correct corresponding to the Distribution Provisioning profile
N.B If all the above things are correct,then make sure your app is in background, If your App is in foreground, then you will receive push notification, but wont be able to see it
Keep in mind that the Ad hoc testing of push notifications only works if the app was installed on a device without using xcode+usb cable to install the app on the device. The app has to be delivered to the phone with either TestFlight (or similar) or something else like diawi.com
You can check in server side.
List<PushedNotification> notifications = Push.alert("TEST TEST",keystorePath,"test", ***true***, devices); => For Distribution
For development => List<PushedNotification> notifications = Push.alert("TEST TEST",keystorePath,"test", ***False***, devices)
Check your device token. There are two device tokens. First one is when you run app with development other one is run app with production. These are difference. Use Ad-hoc device token.

Is it possible to get push notification through enterprise provision profile (In House Enterprise)?

Is it possible to get push notification through enterprise provision profile?
I am not releasing the app to app store, So I distribute the app using enterprise provision profile(In House Enterprise). My question is
1) Enterprise provision profile(In House Enterprise) get push notification for that app without adding the UDID ?
Thanks.
Yes you can, just like a with a normal app store app. Just register for push notification and send the received token to your APNS server.
Yes, It is possible to get push notification distributed using enterprise provisioning. Just ensure that you are using the right certificate for the app.
Your device gets registered irrespective of the type of the provisioning profile.

Resources