iOS Firebase Push Notification for sandbox only - ios

I am trying to send a PUSH message to iOS using the Firebase. APNS certificate has been set up for the development and production, and It is confirmed that the remote message can be received. I think there is no way to send a message only for development in Firebase Console.

Not directly, there is no dev vs prod switch in the message composer.
One option is to have dev builds subscribe to topics with a _dev appended to them then only send to the _dev topics when developing.

As discussed above, you cannot send directly without knowing which devices are having development build or having production build.
What you can try is
Based on the scheme you are running/releaseing, set a firebase property, say isDevBuild, with values Yes for dev builds and No for prodbuild.
This property will be available for you in firebase console when you are composing the notification message.
Based on user-property if you set the property as Yes, the notification will be sent to all devices which has a dev build.
or
Create a separate firebase project for dev and prod.
This will help you in separating all your dev info (analytics, notification info) with prod info.
Hope this helps.

Related

Push notification not delivered from Amazon Pinpoint Campaigns

I created a Amazon Pinpoint project using a production certificate from my Apple developer account, I configured my Xcode project with the project ID and APS environment equal to 'production' , I upload the app to TestFlight and then install it in my device, when I send a message using the 'Test messaging' Amazon Pinpoint option (using an specific Endpoint Id or Device Token) the push notification is sent and received in my device, but when I launch a Campaign everything looks ok but I never received the push notification in my device, regardless that the segment I choose is dynamic and shows 1 eligible endpoint (I assume is mine because only I have installed this version).
Can anyone shed any light on this? Thanks in advance!
P.D: In the development environment both works, the message to specific device and the campaign.
UPDATE: I've research in all Amazon pinpoint documentation and is unclear the solution and in other posts from AWS forums and stackoverflow I found that the solution is use the APNs Production certificate and I've already done this.
I found that this line of code in the function didFinishLaunchingWithOptions, the debug mode was always in true:
// Enabling app to receive push notification from Amazon Pinpoint
// Instantiate Pinpoint
let pinpointConfiguration = AWSPinpointConfiguration
.defaultPinpointConfiguration(launchOptions: launchOptions)
// Set debug mode to use APNS sandbox, make sure to toggle for your production app
pinpointConfiguration.debug = false
pinpoint = AWSPinpoint(configuration: pinpointConfiguration)
So the device could not be able to receive the remote notification from Amazon pinpoint

Testing push notifications in development with APNS HTTP/2

I am trying to determine what I need to do with respect to the combination of APNS endpoint (e.g., development or production), Xcode, and Apple Push certificates in order to test push notifications while in development. I feel like I've tried every possible combination, but I must be missing something ...
Background
When using Apple's HTTP/2 APNS endpoints from my "dispatch" server, my app/device does not receive pushes, and I receive a BadDeviceToken response from Apple.
Using the exact same .p12 certificate and deviceToken with the Pusher macOS testing app (which uses legacy APNS endpoints), the pushes successfully deliver.
To complicate this further ...
When using Apple's HTTP/2 APNS endpoints from my "dispatch" server for PassKit pushes, my pass/device does receive pushes.
So ...
Point #3 tells me that my "dispatch" server must be configured properly, because pushes to the Apple Wallet pass cause a response (e.g., I can see follow-on requests to my server's endpoints from the Wallet / the pass).
That said, Apple Wallet is a "Production" app. I suspect that, because my app (from Point #1) is non-production/development, something is different.
.
Question
Has anyone been able to successfully receive -- in Xcode -- push notifications sent to Apple's api.development.push.apple.com endpoint? Can you outline the steps you performed (which certificate from developers.apple.com, etc.)? Thank you!
You should be able to send development push from server:
You need to connect to api.development.push.apple.com:443 instead of api.push.apple.com:443. You can use production certificate for both.
Sending push to production server can not work with development builds - only with a build that is exported with AppStore configuration, but you can't debug those (at least not with Xcode)
If you need to check whether the production endpoint works, you can use testflight
Set development certificate from apple developer portal.
Use either production/test server for communicating with APNS.
Edit your target scheme as follows :
This will ensure that when push notification arrives, control will itself fall in the code. It might seem confusing. But here it is how it works :
- Install app on device and stop the Run process from Xcode.
- Place a breakpoint on didReceiveRemoteNotification.
- Send a push notification to device.
- Xcode will itself start the app and control will go to the above function.

iOS Push Notificationss log/history or trace

I'm trying to test Push Notifications on an app which has been developed by other team. We have the app installed in our device and validated (the app is no yet in the App Store).
Connection parameters with APNS server are ok.
We launch our script to execute the Push Notification but we don't receive any notification in our device/app.
Question:
There are any log or trace in APNS of our demands?
Have APNS any history of the Notifications sended and its status ?
Note : We use Adobe Campaign to generate Push Notifications services.
We've tested the flux with an alpha version of the app and worked but now with a RC candidate doesn't work.
Thanks in advance
I recommend to check all these possibilities:
Notification is not sent from server
Try to log apns response to see if this is the issue
Check if apple certificates used are expired
Check if you're sending notification using development or production certificates with the right gateway. As Apple say:
The binary interface of the production environment is available through gateway.push.apple.com, port 2195; the binary interface of the development environment is available through gateway.sandbox.push.apple.com, port 2195.
Notification is sent from server but is not received by device
Check in settings if push notification are enabled for your app
Check if some code is hiding the notification when the app is in foregroud or is working in background
Check if you have installed the right environment application (if you send notification for production you won't receive nothing in a development build of the app)
Check the device token used to send notification
Did your app communicate to your server that it is a staging app and that the script should send APN via the Apple staging server?
Did you also deploy staging certs/keys to your server?
Did you log the response you got from the APN server when your server communicated with it?
Use APN Tester app save my day, thanks "sanandiya viper".
The problem was app's developers don't tell us p12 certificate is production one and we installed it as developer certificate. APN Tester bring us the choice to test booth options.
Thanks for all your answer. Problem solved.

Bluemix Push Notification service not working anymore?

I have a native iOS Swift app talking to a Node.js Bluemix backend with MobileFirst services (AMA, Cloudant, Push iOS 8), which worked well for over a month. A few days ago I noticed that I could no longer register new devices from the iOS app (IMFPushClient.sharedInstance().registerDeviceToken() responded with a 404).
I knew that changes had been made recently to the MobileFirst services (e.g. the various push services were merged into one), so I figured I should rebind those services. This resolved the registration issue, but I haven't been able to receive push notifications ever since.
This is what I tried:
created a completely new backend with the "MobileFirst Services Starter" boilerplate
cloned the most recent version of the "Bluelist" sample app and configured it for this new backend
issued a new APNs certificate for my bundle ID and uploaded it to the push service
successfully registered for push notifications on my device. I have verified this by calling the /devices REST API (essentially, I followed these steps).
Now every time I use the REST API to send messages (after figuring out that the bearer token approach was replaced with a new "appSecret" header), I get an HTTP 202, but the notification never arrives. Likewise, when I try to send the message through the service's dashboard, I get a success message, but the notification never arrives.
One thing I noted is that the symptoms stay the same even if I don't provide the .p12 certificate to the service, so I wonder if this might be some certificate issue, but I have no idea how to trace this. Also, IIRC the "old" MobileFirst services required me to provide the bundle ID and version of the mobile app, but this seems to be gone now. Any help is greatly appreciated.
We were able to solve the issue above by making sure the sandbox environment was using a sandbox .p12 file. To verify this setting go to the IBM Push Notification Dashboard and click the Configuration tab:
Here you can see the Certificate Type of the .p12 file you have uploaded. Make sure if you are using the Sandbox environment it is listed as Sandbox. Same is true for the Production environment.

Is it possible to test my Parse.com setup after making app changes if the app is already in the app store?

I've setup my app with Parse.com and for the first release and everything was working. Since, I've updated the app and changed my Parse.com integration slightly.
I've got my single production certificate setup in Parse for notifications.
Before submitting these updates to the App Store, is it possible to test these new features without interrupting or sending test notifications out to current users?
You could try setting the channel of your push notification to "TestChannel" or something within the testing version of your app, then create a new push notification that only broadcasts to installations subscribed to "TestChannel" instead of all users

Resources