Push notification on webview - Android / iOS

1

I have an app running a webview. It is a system on the web and the webview with the app.

In the system, there are certain actions that the system sends push notification to the user.

I did the integration with firebase cloud messaging Javascript. But it does not work in webview, only accessing directly through the browser.

From what I was researching, I would have to configure the javascript part, for web, and in webview to set up again to work in webview, but my knowledge of Java is very little, and I use the web database to send the push.

Does anyone know if I can do this integration via Javascript and work in both the browser and webview?

    
asked by anonymous 12.03.2018 / 17:56

1 answer

1

javaScript is not heavily embedded in an iOS App. What you can do is go in your method that receives the Push Notification (if it does not, just implement it in AppDelegate, as it should have).

And then, instead of WebView, try using CSafariWebKit . Apple recommends that you do not mislead your user by using webview if the content is web. The exception is if you need something more custom and the screen is entirely from your app.

In your file

import CSafariWebKit

And wherever you want to call WebView

let vc = SafariViewController(url: url, barTintColor: nil, tintColor: nil)
vc.presentSafari(fromViewController: self, whenDidFinish: nil)

Use the colors of your app for a better experience.

    
14.05.2018 / 02:26