Is it possible to create Custom Push Notifications with a REST service backed server? - rest

I have an OpenEdge database, I have created a REST Service and am able to CRUD to it from the outside World.
I have created a Nativescript app that can pull data from the REST service etc, but now i want Push notifications.
I know about the Progress Kinvey backend, and Firebase backend with their push notification features but i don't want to use them.
is there a way to create my own Push notifications on my REST server etc?

So first I would like you to understand how Push Notification works just to make sure we are on same page,
Once your app is installed, you can query for a unique token and save it in your backend for future use. Whenever you want to send a push notification, you have communicate with APNs (Apple Push Notification Server) / FCM (Firebase Cloud Messaging) in order to send a push notification to your iOS / Android device using the unique token you acquired earlier.
So now you must use Firebase as that is the only way you can communicate with Android, yet you may choose to communicate with APNs yourself. But in my opinion, it will be a overhead for you as both have their own protocols, you will have to distinguish your tokens between iOS & Android, use appropriate protocols etc.,
I would suggest you to go with just Firebase plugin (until you are super familiar with APNs already), so you don't have to worry which platform the token belongs to, update / revoke invalid tokens over time etc., FCM has pretty decent APIs & Documentation that can make your life easy here.

i strongly recommend you to see my answer here answer here.
from it:
when you want to pull anything from place_1(e.g. api) to place_2(e.g. browser_client) you most have an identifier of the
place_1_resource (which commonly is the uniform-resource-locator of
api)
when you want to push anything from place_1(e.g. notification_central_server) to place_2(cellphone_client) you most
have an identifier of the place_2_resource
if you don't have any identifier for a cellphone which you want to
send it a notification, your server dont know where to send that
notification so we need a resource_identifier_like for cellphones
which is actually a device_token_like and you have just one approach
to get this device_token_like and that is the FCM/APNS

Related

How to get the latest version information using APS

I am developing one application.In that i want to get the latest version of my app information using Apple Push Notifications.So please tell me how to do this one.I seen in some posts,in that they mension like configure the APNS in apple site and send abinary information to apple service provider.Is it sufficient to get the latest version information.
You will need to create your own server, to store the identifiers for your users. With this, you can then send notifications to users who have allowed notifications from your app.
Doing this can be quite complicated, so you may want to use a service such as Urban Airship who will provide the server, and instructions on how to implement APNS in your app.
With this done, it can be quite simple to send a push notification to your users from their website.

Implementing Apple Push Notification without an access to a source server

I'd like to implement some push notifications from Twitter in my app. I can connect to Twitter's stream of user-related events using Sreaming API. Do I need some 'middleman' server between Twitter API and an iPhone app in order to push a notification to an app ? Maybe I can do it using Parse.com Cloud Code or something similar ?
This question may be helpful not only in the case of the Twitter API but also in case of any server that a developer don't have any access to.
To push a notification you would generally need a server of your own which has been configured to send a notification when some event occurs. If you are using Parse as a backend for your app, you can leverage their backend to allow you to implement Push Notifications or use a service like UrbanAirship
In the case of the Twitter API, you will need to implement some middleman in either case to get the data from Twitter for your user and parse it to see whether some event has occurred and then send off a notification either using your own custom logic directly to Apple's servers or using Parse or UrbanAirship (or some other service)

Understanding details of Apple Push Notification Service

Is it true that we can use any component for our own server component? I mean it can be a Java or C# TCP/IP client which connects with Apple servers to push notifications. This can also be a console application, is that right?
Also, is it right that we have to push notifications for APN server, with each and every deviceTokens registered on our own server?
You can use whatever language you want and you will have to send push notifications for every registered device token. You should also investigate apple's feedback API's which you should periodically check to see which of your devices are no longer registered because sending a push has no feedback and you will not know if it is being received or not. If you use a service such as Urban Airship the setup will be much much easier to start and they have helpful API's to give them a group of device tokens or to do a mass push to all registered device tokens.
You are right on both accounts. You can write your own method to send it, and you must send it to each device id.
framework that might help you:
http://www.easyapns.com/

Retrieve and save all Apple Push Notification Device Tokens in our server for APNS?

Am trying to integrate Apple Push Notification in my app. I have studied the Apple Document and other tutorials for my understanding. But, still i have a doubt to create a server and store all Apple Push Notification devicetokens in the database. Am not going to work on Server side but, i need to explain the approach to my client. I need to understand to create a APNS server provider and save all the apple push notification device tokens and retrieve all devicetoken and retrieve a single devicetoken to send notificaions. Can you please suggest me any sample code to save all apn devicetokens and retrieve from the server? I suggest my client to create a server in C#.net platform is this correct? Thanks in advance.
Essentially, you just need to decide on a way for your app to let your servers know the device tokens. So, there are many ways to achieve this.
If your server side already involves a website, the easiest way would be to use HTTPS to do a POST request from your app. Then, the server-side code can be written as if it is handling form request from browsers. I can't really give you sample code since I don't know any C#, but this should be familiar to any web developer.

How to check if a person in your iPhone contact list has an app installed?

I want to allow people to privately share data with each other using their contacts list to select people to share with. I'm planning on using Push Notifications to notify others that they have been shared with, but how can I handle those that do not have the app installed?
The cases are that I have their phone # and/or email. I can simply send them a message saying "X wants to share Y with you", but how can I determine if I need to send a Push Notification or an email/text?
If you're looking for API then you're out of luck. You can always collect this personal data server-side with agreement of your users. There you can also manage groups and other community relations.
Check here:
https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html
The crux of it though will be that you will need to store a token when the device is registered anyway to be able to send notifications to them, so you can use that.
And using The Feedback Service alluded to in the documentation, you can remove the token, should it fail too often.
But, as rokjarc said, if you're expecting a third-party API to exist, you're pretty much out of luck. Apple ahs done most of the work for you already anyway.
When the app registeres for push notifications you need to pass additional data to your server. The user could input their own email/phone which will be sent to the server so that users can find each other. The email/phone can be stored alongside with the push token. When someone wants to share something, you would search the corresponding push token in the database and send the notification through APNS. Note there can be multiple push tokens for one email or phone i.e. when a user has multiple devices.
The users of your app should be aware of the data which is stored on your server and should have the option to delete it. Also use the APNS feedback service to detect and remove invalid push tokens.