I am build an app based on webView. the website is already functional with oneSignal Notification (website is codeignator based). I want the same notifications to be thrown to the users of that APP webView.
You should set up push notifications for each channel (i.e: Web and Mobile). We have SDKs for both platforms making it easy to seamlessly send to both.
Read more here
Related
I am working on one product using CRA, Service Worker and PWA. Everything is working fine in both iOS and Android devices. But I need push notification for my new functionalities launched in my pwa for end users.
In Android using firebase and push notification api its possible to implement but in iOS I am not able to implement as push notification is not supported in any of the iOS version.
Please suggest how to implement or is any way available for sending push notification in iOS devices also.
I have a website which is responsive and push notification feature enabled. In my native android app, if i load my website in a WebView, then the pop up which usually comes in chrome/firefox to ask if user wants to allow push notification or not, doesn't shows up in WebView. And obviously the WebView won't support the same web push notification for the app. I know how to implement GCM or FCM in app to enable mobile push, but i wanted to know if it possible just to club the web push notification with android webview so that it would work in my app as it is working in chrome/firefox etc.
What I tried: After digging deeper into this, I finally concluded that as android WebView doesn't support Push Api (with the help of caniuse.com), clubbing of web push with mobile push using WebView is not possible as of now. Am I right? Or is there any app which already does this? Is it possible somehow?
Ow, of course this is possible!
I easily implemented push web notifications from one signal in my webview App using crosswalk.
Uses crosswalk, extends Main activity to XWalkactivity
Put this on on create:
OneSignal.startInit(this)
.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
.unsubscribeWhenNotificationsAreDisabled(true)
.init();
Yeah, you will have web push notifications working!!!
As I'm aware, it's not possible using only WebView .
The solution that worked for me was to find whether the website you want to display in the WebView uses WebSockets. If yes, the notification will probably be available in the according WebSocket communication. The workflow is following:
Determine WebSocket on the website. You can use Firefox "Inspect Code" and in "Network" tab filter out only WebSocket entries.
You can test connection to ws via various tools. Simple-WebSocket-Client for Firefox or command line tool. Simply provide URI to your WebSocket (ws://domain.example/ws).
Implement WebSocket client in your application. There's been different posts on how to do that. I've used this lib to make it nice and clean.
Now you are receiving messages from server, such as notifications.
Parse them and do whatever you want.
I have installed onesignal push on my ionic app, it worked well but when i send web push and by clicking on that specific notification on my Android device it takes me to external browser to open that notification.
Now I want what ever type of notification i will send from one signal to my app it should only open app, not browser not more than that.
You must omit setting a Launch URL on the OneSignal dashboard or the url field if you are using the REST API. You will need to send two different notifications if you need to still direct the user to a specific URL for your web push users.
For opening a link with your app, you can use the custom-url-scheme cordova plugin . This enables you to open your app with an external link like testapp://path?foo=bar . Here is the link
I just built an ecommerce app using ionic and wooCommerce as the backend. i send Push notifications with OneSignal and it's been excellent so far. What i would like to do is this:
How can I target a particular path/ page in an ionic app for android using Onesignal when the notification is tapped
Thanks all.
When using OneSignal with Ionic, to direct users to a specific location in your app, make sure to send all the relevant information as part of the additional data and handle launching the relevant page within the handleNotificationOpened event.
I followed the google documents to create a progressive webapp and I've just implemented push notifications, however whenever I close the app I don't get any notifications.
Other apps like whatsapp seem to be able to send those notifications is there a difference between native notifications and gcm push notifications from a progressive webapp?
There absolutely no difference between the two, the rendering part is the same, it just that native ones are the notifications that comes from a apk generated app and the other one is rendered using google chrome or any web browser that support the functionality.
Beside the service worker with the help of manifest.json file will use the GCM ( Google Cloud Messaging) to send notifications to end users.
I worked and implemented such functionalities before, and I got my notification directly to the browser and my android phone as well, therefore I created a Github repo with nice documentation that simulate just that using Nodejs and simple web interface, please feel free to check I guess it holds what you seek :
Link : https://github.com/houssem-yahiaoui/webpush-notification