a- If the app is not working in the background, how can it take push notification? Or how will it come?
b-“The app has to support a registration process and it must support incoming messages.” Could you explain details of this issue? Should the app have a process for users about registering the system by email, name etc? Or something different?
c- I am good about using rss feed systems. I can trigger local notification when the user starts the application. But I want to trigger it with my command. Lets be more clear:
- The user installs the application. (11:00)
- The user opens the application. (11:30) It checks the rss and store some data.
- The user closes the application or close the phone (12:00)
- The user opens the phone. (14:00)
- Phone checks if there is a new content or not (15:00) No new content, no new notification . Because the data is still same with no 2.
- The admin gives a new content by rss (18:43)
- Phone checks if there is a new content or not (19:00) Phone detects a notification because the rss is different from no 5 or no 1.
- It triggers an local notification. Notification pics come from local files of the app.
- Phone gives an local notification (19:01)
- The user notices the notification by sound or by shake (19.01)
Extra - The admin gets a feedback from the app that if the user gets the notification or not (Not very important section)
I tried to write very clear. I am not looking for coding of course but I am trying to figure out that if it is possible with corona or not.
a - Push notifications do not require the app to be running. On iOS the OS handles the notification. On Android, I believe it calls part of your program (which Corona does under the hood) to handle the notifiacation.
Depending on the state of the app, how the app handles the push varies:
- App is not in memory, use interacts with the push:
In this case, the OS starts your app and you will get a launchArgs table set that has the data from the push notification in it.
- App is not in memory, push comes in, but the user starts the app from it’s main icon:
The app gets no information from the push notification. No events are generated, no launchArgs is set.
- The App is in the foreground running:
The App will get a notification event and your app should handle it as necessary
- The App is backgrounded, user interacts with the push:
App is foregrounded and receives a notification event.
- The app is backgrounded, user starts the app from it’s icon.
Like above, no push events are generated and there is no way for the app to get info from the push.
B. When your app starts up, you will get a registerDevice event. This will include a really long hex string that identifes your device. Corona will automatically send this data to Apple or Google (if you have things setup correctly) to register the device-app combination with their servers than send push notifications. Then it’s your responsibility to respond to the register event and update your push notification sender (PushWoosh, Urban Airship, One Signal, Parse.com, etc.) to register the device with your push service (this could be a push service you set up yourself!). No need to collect any additional data for Apple or Google’s use. I also don’t think most push providers want any personal information. Though you may need to collect things like segment information (Person wants Sports pushes, Weather pushes, Traffic alerts via push for say a news app).
C7. You don’t need a push or local notification for this. You want something like native.showAlert() to notifiy the user there are new messages.
In your C example, all interactivity is triggered by the app user. They wake up their app and checks the server for new data. There is no reason to use push notifications in this model. Now if you change your model where you want to let your user know there are updates without them checking your app periodically, then push notifications will be a great tool for you.
Rob