React native Cloudkit push notifications in android - javascript

How to register for cloudkit push notifications in react-native android?
Thanks!

I'm not sure what the influence of react native is, but generally speaking CloudKit would function like this:
If you are using the webservice api, then you can only modify subscriptions. You can not register for a subscription. See: https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/Introduction/Introduction.html
If you are using the javascript api, then you can also subscribe. See https://developer.apple.com/library/ios/documentation/CloudKitJS/Reference/CloudKitJSTypesReference/index.html#//apple_ref/javascript/struct/CloudKit.Subscription
I assume that the javascript subscription will only work as long as your application is active and your created subscription is active. I have no experience with this, so I could be wrong.

Related

React native webview push notification

Nice to meet you. I'm Junior Developer And I can't speak English very well.
So, plz understand.
I want to create a hybrid app push function with react-native.
but, All I know is postmessage, onmessage.
Sending words typed on the web to the app and clicking a button in the app to send time to the web were successful.
I want to know if the push function we know is completed by using postmessage, onmessage, and push nofication.
Android & iOS
And I'd like to know the site where I can refer to these techniques. thank you
-> Summary
I want to make hybrid app + Push nofitication

Laravel and Flutter Notifications System

I Want to Build a Web App with Mobile App in one platform. So, Both of Them will use the Same Database which is MySQL.
I want to use Laravel as backend and flutter for mobile app
Also, I want to build notifications system "when the user does something he will get pop up notification"
and that is the problem.
I searched a lot about this but I found nothing.
for Laravel, I can use Pusher and it's pretty easy.
but I didn't found anything to integrate it to flutter.
NOTE:
I'm beginner at flutter. But i'm good at laravel.
UPDATE
it's okey if there is any other method to do this
For flutter there is package called flutter_local_notifications,
link: https://pub.dev/packages/flutter_local_notifications
also there is pusher package
https://pub.dev/packages/pusher
so you can use these 2 together, so when a user trigger an event with API, a listener will send notification to pusher, so the other user would listen to it using pusher package.
At this moment you got the notification on your mobile using pusher package, only then you can trigger local notification using the other package instantly.

How to Receive Push Notification on website using Parse JS SDK?

I have configured push notifications on Parse-Server & in Android app. But I am not able receive push notifications in a website using Parse JS SDK. They don't provide any method to subscribe for push notifications in ther JS APIs. There Documentation (JS) only talks about subscribing to mobile devices not browsers.
SUBSCRIBING TO CHANNELS
The JavaScript SDK does not currently support subscribing iOS and Android devices for pushes. Take a look at the iOS, Android or REST Push guide using the platform toggle at the top.
So, I concluded that web browsers can't subscribe just by using Parse JS SDK? So, how should I subscribe & receive Push notifications on a web browser from Parse Backend?
Update:
I haven't test but If I use ServiceWorker to get subscription & subscribe user to some channel, can I use the default Parse Class Installation for saving subscription & then use that (web) Installation in Cloud Code to send Push?
Parse-Server only supports iOS and Android push notifications. It doesn't even handle web sessions conveniently. There are no Installations for web, because you don't install things for web. There are Sessions, but those don't do anything for Push.
I have tested it and got achieved desired results via following. As Jake said, for web there are no Installations in Parse. So, in order to receive push notifications on the web, you have to
Register a Service worker to get pushSubscription and hande push, click events etc.
Save pushSubscription to server. It will be used to send pushes to Web.
Integrate Push notifications on Parse-Server (FCM etc) or web-push if you want.
Send push via Client SDK or Cloud Code, it must be received.
Further, the Installation class cannot be used for web pushes.

Geofence and send push notifications

before I learn react native from scratch, I was wondering if it is possible to geofence certain areas and then send push notifications to the user when he enters the geofenced areas even if he is currently not using the app. Thank you
You can access official documentation of Push Notification:
https://facebook.github.io/react-native/docs/pushnotificationios.html
Added a sample apps for you to take a look:
https://github.com/transistorsoft/rn-background-geolocation-demo
https://github.com/zo0r/react-native-push-notification
Basically you should enable push notification in your project and save the location you get from the navigator.geolocation.getCurrentPosition callback somewhere in you app, you could use AsyncStorage for that purpose. callback is only called if the location is changed.

React Native display message at certain time when app is disabled

How is it possible to have React Native trigger some kind of message on the device at a certain time, even if the app is currently not selected or closed down altogether?
I would simply use a push notification. This is something you will need to setup server side but it sounds like you have a good use case. You will need to setup permissions etc for this.
Maybe also a good use case for local notifications take a look at React Native Docs
A small completion to #JamesWatling's answer. You'll need at least:
AppState (https://facebook.github.io/react-native/docs/appstate.html#content) to post the timestamp to server, when app is moved to background
Push Notifications (e.g. https://onesignal.com/ or for iOS: https://facebook.github.io/react-native/docs/pushnotificationios.html#content) to send a notification after certain amount of time
You might want to have a look at this part of the react native documentation and focus on local notifications. You don't need a server or anything to schedule a notification at a given time, a local notification is scheduled without a server interfering.
I do believe your app is going to need to have permissions for push notifications though (so the app is allowed to display a message on a homescreen for instance)

Categories

Resources