I am new to ionic framework. I developing an app using ionic 2. I have a requirement to show alert message when a new message arrives. I need help to write a code to show notification/alert.
I went though ionic 2 doc about native-push.
Hi @mhartington thanks for the prompt response. We built our app using Ionic v2. To our surprise most of the native calls (Push & Camera) are not going smooth and our App release is totally blocked. If you could publish the timeline for native calls support from Ionic v2 that would help us align our product strategy better.
To jump on @raja.co.in comment, if @mhartington or someone else from the team could give a rough timeline for some of these native integrations, that would be awesome. I have my app 90% complete and loving the use of TypeScript and Angular 2, but the native integrations are blocking the release. Yes, I realize that Ionic2 is in Beta and I definitely don’t want to sound ungrateful, but I am excited to get the app out in the wild. A rough timeline, even if it slips, would be awesome!
Or if someone knows a workaround to get the device token for push notifications for uses with Amazon SES, for example, that would be helpful in the interim.
I manage to get it working, just install the plugin and follow the steps to configure it (you can find them in the plugin repo), I used gcm for both iOS and Android, but get iOS working has been a real headache.
Init push on app file, and ask me if you have ant doubt
I set it up per installation, followed the example app code ( /plugins/phonegap-plugin-push/example/www/ ), and then implemented a PHP CURL script (customised from here https://gist.github.com/prime31/5675017) to fire off the Notifications (once my app was registered with the GCM I setup).
Can anyone of you (@ZiFFeL@nebrekab) help me in getting a Ionic 2 sample app for push notification. It has to contain all code samples end to end and it should work both in Android & iOS.
I would appreciate some help here.
I can’t set it up in my app (ionic2 with typescript).
Tried to install phonegap-plugin-push, using their example code from https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/TYPESCRIPT.md (I put this code in app.js)
But when running ionic serve, I get error TypeScript error: app/app.ts(32,18): Error TS2304: Cannot find name 'PushNotification'.
I probably missing some import command or so, I would highly appreciate if someone could post full example…
At last the thread grabbed some attention. I did try out all the examples but none of them worked for ionic 2. Hope the solution proposed by @nunoarruda works. Will keep you guys posted. Thanks guys for all the support so far. By the way, I certainly like the offer
I just got OneSignal working in a V2 TypeScript app yesterday. Only to the point of sending a Notification from their dashboard but it seems to work fine.
The key to my finally getting it to work was using this: this.pluginObj = (<any>window).plugins.OneSignal;
Then window.plugins.OneSignal.init() as described in the OneSignal docs worked. It still showed as an error in mt editor ( VS Code ) but worked otherwise.