Android webview with fcm - java

I have a website and I made FCM instant notifications with Google Firebase. Notifications working ok.
I want to make an android application that will just open the site as an application and publish it on Google Play.
I tried to do with a webviewer, the site work ok but I do not receive notifications and he don't ask for access.
Could someone give me some ideas to solve my problem?

You have to do a whole process to get Notification Push on your android application, you cannot receive (on the mobile app) the same way you receive the notification on your website.
See for more information : https://firebase.google.com/docs/cloud-messaging/android/client

Related

How to send push-notifications from java-server?

I have apps on Android & iOS, & I need to send push-notifications to them from Java-server.
Please tell me, where can I find guides how to do this? I'm looking GCM & APN for Android.
https://firebase.google.com/
That is what I use for project and I am satisfied with it.
You have all needed tutorials and docs to start working with it.
Overview:
firebase provides You with Admin SDK wich helps You build Data and Notification messages and send it to firebase, firebase then sends it to either iOS or Android if You send it to specific client or to both if You send it to some created topic.
It also have easy to use Android, iOS, JavaScript libs to handle it on client-side.
ofc to get this work with Your server Client must generate notification token from provided google api and send it to Your server to store in DB.
there are some restriction though with push notifications 2kb if I remember correctly and 4kb for data messages keep it in mind when you create your communication architecture :)

How to add push notification to WebView App (both android and iOS)

Hi I am developing an webview app using Java and Objective-C. My client wants me to implement push notification in the app. But no push notification service (like firebase, OneSignal) is added in the website. is it possible to add push notification in the app??
Badly need some suggestions.. Thanks in advance..
You can still use Firebase when you dont want to add it to website.
i did it so :
FCM service on andoid registers device token to my MySQl server, my Webpage generates Push notifications, with PHP and Cron by selecting tokens from SQL.
When you want to create push notifications, then you need to add something to webpage anyway. (you have to generate message and also send them to devices who have installed your app. :). )
So :
FCM, MySQl, PHP/Java/js or something what selects message and token and sends them to FCM, FCM sends it to devices.

Android WebView with notification on new message

I have messaging php based application where users login and send messages to each other.
I created an android app that is a WebView pointing to that website to give and in-app feeling to my users.
Now I'd like to add a notification feature to the app which will notify users every time they receive a message.
Is it possible to do so with a WebView based application ?
Thanks
You could send a notification from the php using Google Cloud Messaging every time there is a new message for that user.
Take a look here http://developer.android.com/guide/google/gcm/index.html

Android c2dm push notifications after app reinstall

I have the following question:
I've successfully implemented C2DM in my application. I'm registering to both google c2dm cloud and a custom server that "creates" notification contents. Everything is working fine.
My question is : what happens when i uninstall my app and then reinstall it on the same device? I've noticed that C2DM is sending me back the same app_key, so apparently there's no way to determine my app installation status change. And i keep on receiving old push notification (they're customized by user preferences in the app).
I won't be able to test with a google play published app until final release, so i would like to know if there's a chance that google itself could notify c2dm that the app was uninstalled on my device and force it to change my app_id at next restart.
Thanks in advance
Stefano
From what I understand in C2DM, you shouldn't depend on Google's registration ID by itself. They "promise" nothing - you might even get a new registration ID without a clear reason (might be their own vrsion upgrades, etc.).
If you want to follow installation - you should do it with your own server - create a unique identifier whenever the app asks for registration, and use it and not the Google's registration ID.
Regarding to Google Play - couldn't find a difference between published app and unpublished one - the behavior seems to be the same.
Hope this helps somehow.
Shushu

How does the c2dm application push to the Android app?

I am new in Android and trying to develop an app with push notification. I have a small confusion on the architecture behind the c2dm, that after getting the authentication token and device reg_Id, the application server will send them along with the message, but how will the server will know to send the message to the c2dm server?
I am getting an error and even I am not able to add a google account on my emulator for synchronization. While doing this my emulator says com.android.calender not there.
Thanks in advance.
you have to call web service to sent push notification on particular device. And whatever the massage you want to pass on device is written in web service. you can make web service any any language like php or .net. Ask me if you have any query regarding push.

Categories