I'm attempting to automate the testing of my push notifications using XCTest and Continuous Integration with Xcode Server.
As far as I can tell, I have correctly configured my push notifications, as I receive them correctly when the app is running. The issue is, when I run a test (even on a physical device) I don't receive the notification. I have confirmed on both the sending device as well as the backend that the push notification has been sent. As far as I know, you cannot receive push notifications on iOS simulators, but I am running the test on an actual device, so I was assuming this would be different.
Obviously I can check manually to see if the information is consistent through the sending device, backend and receiving device, but I was hoping to automate this entire process.
Thanks for the help.
While there is no way to deal with PNs on Simulator with Apple-provided instruments, there is magic 3-rd party toolset to help on it:
https://github.com/acoomans/SimulatorRemoteNotifications
SimulatorRemoteNotifications is a library to send mock remote notifications to the iOS simulator.
The library extends UIApplication by embedding a mini server that listen for UDP packets containing JSON-formated payload, and a service to send notifications to the mini server.
This project includes the iOS Simulator Notifications MacOSX app to help you send the mock notifications.
Related
I am not getting PushKit notification on application downloaded from AppStore. Though it works fine if I install it directly from XCode.
I am using PushKit along with CallKit for VoIP calls.
The Apple server used for Production mode is api.push.apple.com:443, whereas the server used for Development mode is api.sandbox.push.apple.com:443
Read here: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns
Make sure the backend mechanism addresses the correct server for each mode.
I'm working on linphone iOS repository and I made some UI changes and added some new features to it for customization! Now, I wanna add VoIP PushKit capability to this project for receive incoming calls when app is in background mode or force closed by user!
I created all necessary certificates for it from the apple developer account and everything is ok in development mode ( when run the app in my iPhone by usb cable ) but when I build the app for production mode and send it to AppStore connect and release it to TestFlight, The app can not receive pushes from APNS! PushKit Token is registered and I save it in my server db successfully but when I send a VoIP push to app, is not received! I try to get log of installed app ( TestFlight mode ) and I've found out push receive to OS but the OS not awake the app and delivered the push to my app!
Please help me to fix this problem! TNX all!
If in your development environment, everything is working (meaning: you get the PushKit notification and also the corresponding SIP INVITE and CallKit is launched and you can take the call), it probably means that you haven't switched your APNS client from development to production. See e.g. under https://github.com/nomad/houston :
# conveniently use `Houston::Client.development` or `Houston::Client.production`.
APN = Houston::Client.development
APN.certificate = File.read('/path/to/apple_push_notification.pem')
I have implemented push notification in my iOS App using Firebase SDK and I am successfully getting push notifications from Firebase console as well as from server.
But on many occasions, I wait and wait, and even send 5-6 notifications from Firebase console but not received on App. I tried to change network (both Mobile data & WiFi) but still not receiving. After waiting for an hour and more, suddenly it starts working (I am not re-installing App).
What may be the reason? If network is an issue, then why is it not woking though I change my network to WiFi having good bandwidth?
Over the last few months, we have been integrating Firebase Cloud Messaging into our project. The project uses the Firebase SDK, wrapped in a Cordova plug-in (cordova-plugin-firebase).
It is all working great, that is for Android at least. For iOS it is partially working. We received a few complaints from customers about them not receiving notifications, while all of the other iOS devices were correctly receiving messages.
After on-site device checking, we found out:
The device successfully obtained a FCM-token.
This FCM-token was subscribed to all the correct topics.
This FCM-token had the latest app version.
Both individual push-notifications (to the device), as well as topic notifications were not received
Messages from the Firebase Cloud Console were not received either
sometimes reinstalling the app worked
Receiving over Cellar/WiFi did not change anything
Permission was granted to receive push notifications
It is very hard to debug an issue like this, because installing a development version fixes it for some reason.
What are possible reasons for Firebase to not deliver the message to iOS? Or is it possible to see whether a delivery to APNS fails within the Firebase Console?
I have a Mac application and an iOS application. I need to display a notification on iOS, coming from the Mac app.
Is there any easier way to do it than using Push Notifications or network sockets (UDP or TCP)? Maybe Apple provides it away?
I need to make sure that the user hears this notification. The application should launch in the background and start playing sound.
If they are on the same network you can use bonjour ( https://developer.apple.com/bonjour/index.html ) for communication between mac app and iOS app.
If they are on different network you have to use a server, the server will be connected to both mac app and iOS app via tcp, and you can send msgs via the server. And if the iOS device is locked or app is in background you have to implement push notification for sending data to the iOS app.
Not sure of your use case, but using Apple's push notifications to serve notifications for your app seems like a suitable choice. Again, not sure of your use case, but an alternative may be to send a text-message using the Twilio API.
There is another option known as BLE .With BLE you can interact between mac and iOS using core bluetooth framework.
When you receive any message from mac to iOS using this framework you can show a local notification and can wake an app, since BLE also works well in background mode.
For mac to act as peripheral there is a good open source project over here.
you can find more information about BLE here.
Hope this helps.
I think the only acceptable solution is to send push notifications via APNS from mac to iOS device due to limitations on app lifetime on iOS. There is nothing hard in implementing APNS, there are lots of ready implementations, like NWPusher - you may copy it to your project and setup the environment - keys, device tokens - and you're done. To transmit tokens from iOS to your mac app, you may use tons of ways. For example, implement simple web-service on mac and send tokens via http/https.
You may also use a ready server-side implementations, like parse.com, to send push notifications.