Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - "Simulate" Push Notifications

I'm developing an application that in my head needs push notifications. It's a simple app that make something like "orders management". It works like:

  • a user makes his order using his iPhone
  • this order it's remotely saved using a web service
  • the order "appears" to the retailer
  • once the order is completed, a notification is sent to the user

So I think that I need remote notifications to build this app. But I'm not able to create certificates because my type of Apple Membership is bound with my university (Politecnico di Milano) and I haven't permissions to create ids, certificates and so on.

How can I work around my problem? A solution can be to use a separate thread to cyclically look for changes in my web service and then use a local notification?

like image 372
dylaniato Avatar asked Aug 16 '14 15:08

dylaniato


People also ask

Can you test push notification in iOS simulator?

The first step to simulate a push notification in a simulator is creating and storing an . apn file. The file contains the JSON notification payload that the app would otherwise receive from the server.

How do I test iOS push notifications?

To send a test push, go to Mobile Apps > Integrations > Test Push. Use the Apple Sandbox Certificates for Xcode and the Apple Production Certificates when testing from TestFlight.

Can we test push notification in simulator?

As of Xcode 11.4, users are finally able to test Push Notifications via the iOS Simulator. We can send push notifications to the simulator in two different ways: Use a command provided by Xcode Command Line Tools in Terminal. Drag and drop an APNs file onto the target simulator.

Does iOS support push notification?

Apple announced support for web push notifications for Safari on iOS starting in 2023. At the company's annual developer event WWDC in June 2022, Apple announced that this feature was coming to iOS.


2 Answers

The Simulator can not receive notification, however you can try to use https://github.com/acoomans/SimulatorRemoteNotifications which can simulate the fact that your app receive a notification. It basically create a tunel that you can use to send notification in your App. You will not be able to get it to work from your device or when the app is in the background.

like image 76
Hugues BR Avatar answered Sep 18 '22 14:09

Hugues BR


there are no other ways to create a Push notification. You need to create some certificates to communicate with Apple Push Notification Server.
You can simulate something similar in app by using local notification, but it will be a sort of alarm at a specific time, useful if you want to "demo" something.
The other way as you said is poll the server at a specific interval to check if you have some pending information.
If you don't mind to spend 99$you can open your account and probably (if it is for your thesis) ask for a refund to Politecnico ( I did the same while I working for my thesis to cover some expenses).
Andrea (PoliMi Alumni)

like image 22
Andrea Avatar answered Sep 18 '22 14:09

Andrea