Hey Bilbo:

This is a big subject. There is no simple way, but there are hard ways and 
less-hard ways to do this. I suggest you don't write your own PN providers for 
Apple and Google as that's a big project. 

The simplest way we found (and expect this to take you a few days to get 
completely working the way you want it) was to use an ANE that is dedicated to 
using OneSignal which is a FREE push notifications service that will get you 
Android and iOS support relatively easily.

https://airnativeextensions.com/extension/com.distriqt.Notifications

We use this ANE and it's very solid.

You have to carefully read the Wiki instructions on the ANE's github because 
there's a LOT to configuring your custom app descriptor file to support both 
google and apple PNs.

In a nutshell:

For each app, in your Apple developer account certificates page, open your app 
ID and add push notifications support and generate a production APN 
certificate, save and generate your provisioning profile, replacing your old 
one, and export the PN certificate, double click it to get into your keychain, 
then open keychain access and export the public and private keys as a p12. 
You'll need that for OneSignal.

In OneSignal - https://onesignal.com

Sign up for a free account, and add your applications. Configure the iOS first, 
and upload your p12. Then configure your Android if using, but you have to get 
a Google Firebase account here: (https://console.firebase.google.com), and 
create your apps there and copy two keys from Firebase to OneSignal for each 
one. This could take you a while to grok if you haven't worked with firebase 
before.

In the app, if you will blast PNs to all users, you can set up OneSignal to 
just send to active and inactive users. If you want to send to users based on 
any information about that user, you need to register a push token for each 
user during the ANE initialization by creating a service endpoint and hitting 
the API with the push token the ANE generates along with some logged in user 
id. Then you have full capability to send PNs to individuals who meet some 
criteria. Or you can set up segments on OneSignal but that comes with it's own 
headaches because you have to do it manually. OneSignal is free and has APIs 
you can call to send, but no APIs to configure things like user segments. 
You're better off using your own logic and sending to specific users by push 
token.

Be glad there is this ANE, and OneSignal though, because it's harder to do 
native, and especially if you create your own PN service providers. 
Theoretically you can do PNs from AIR directly, we went down that road at first 
and decided it was simpler to use the ANE that wraps the OneSignal native SDK. 
It hides a lot of complexity.

If you decide to go this route, I'm willing to share some source code and 
config settings with you. 

Have fun!

Cheers,

Erik

On Mar 24, 2018, at 12:32 PM, bilbosax <waspenc...@comcast.net> wrote:

I am about to release my first three apps on the App Store.  I am already
thinking about my first program modifications.  I will immediately need to
provide a notification system in my app to let people know when new
properties hit the market.  I have never looked into notifications on AIR
yet.  Do most of you use some sort of service, an ANE, or do you program
notifications manually???

Thanks for any insights!



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/


Reply via email to