Sending APNS notifications with Java - java

I am currently developing Java web services that run on WebLogic on a server. There is a requirement that I need to send push notifications to mobile devices running on iOS. I do know what is required for developing GCM/FCM for sending notifications to Andriod devices. For iOS, I know there is APNS, but what Java library can I use to send the notifications?
Also, what are the required things (registration ID, etc) needed in order to send via APNS?
Any example codes?
I have googled and found out about java-apns and javapns, but I am not even sure if they are obsolete already.
Thanks in advance.

I can help you with what all are the things which are must to implement APNS. Please note that with the introduction of new HTTP/2.0 APNS API, a lot of things have changed which used to be before. (Good news is : Things have really become easy & simple now)
Would advise you to go through the below link:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/Introduction.html
APNS Prerequisites:
1) APNS SSL Certificate, Key (Same for sandbox & production now, previously used to be different for production/development/voip etc. This is the most important step, as most of the issues related to APNS are due to the wrong certificate generation)
2) device token (specific to per iOS app running on an iOS device, your iOS client app needs to register with APNS to get this device token. Also device token is normally different for development & production environments. So please make sure your using the right token)
Once you have above mentioned certificate,key & device token for your iOS App, you can send APNS notifications from your application provider using APNS interface.
Please note that, device token can change anytime (normally during iOS software upgrade), so its always advisable to obtain fresh device token every time your app is launched.
On your query related to java library for apns, please note new APNS interface has a dependency on HTTP/2.0 . Both open source as well as enterprise versions (like AWS, Urban airship etc) are available which you can select based on your needs. Not sure if AWS supports new HTTP/2.0 interface. However its always advisable to use the latest APNS interface as per Apple guidelines.
Optionally, you can also use GCM as well to implement APNS.
https://developers.google.com/cloud-messaging/ios/start
However, your iOS app may need to register to GCM as well for the same. Basically the iOS device token will be mapped to GCM device token. However, you would still need to generate certificate,key as well as device token as I have mentioned.
I hope it answers your query.
_Ayush

Related

Prevent phishing Android apps communicating with server

I have created and published on Google Play an Android app that communicates with my server. I want to check that my server (Java Servlet) only accepts requests from this Android app, so that if someone clones my code and creates a new app, when it tries to communicate with the server, the requests are rejected.
Is there a way to do that? Perhaps with domain names, or signed apps,...? This is to prevent phishing attacks.
You can get your app's signing key and check it on your server, but someone can get this information. If you use https for your connection, and use proguard, I think it's disincentive enough.

How to handle deleted app device token in Pushwoosh?

I am using Pushwoosh for sending notifications to Android and iOS apps from Java Webservices. I found it very easy to use.
I have successfully implemented it. I am using createMessage method with multiple device tokens for sending notifications.
I have used it for many times, and was getting proper response. But after some time I'm getting some device tokens in UnknownDevices key in a response. It is because some devices have deleted the app.
So is there any way that I can handle this situation that not sending notifications to devices which have deleted the app? How can I know that device has deleted the app?
Does Pushwoosh blocks account if I keep sending notifications to devices which has deleted the app?
Thanks
There are two ways of handling this:
Send pushes via Tags feature, where you set Tags on the device with the setTags method, not with push tokens. We will remove invalid/expired tokens for you.
You can use getUnregisteredDevices method, which is currently not documented publicly, but the Support team can provide details. the only disadvantage of this method is that it does not return iOS tokens handled by Apple feedback Service.

How to make Push notification server for my android application?

How i can make my own push notification server for my android & ios application?
m not wanna to use GCM.
GCM and APN are the client side part of the infrastructure. You should still set up your own messaging server. That event-based server will then push messages to the clients via the proprietary infrastructure. I think applications should be respectful of their enironment, and using the push facilities of the platform is indeed a good thing for your users. Also, it should be even easier for you to implement, thanks to the standard setup and the working documentation.
Otherwise, just pick your favourite message queue middleware (Active, Zero, you name it) and integrate it directly with the native client for the supported platforms, without using GCM (or Apple push). But be warned that this will make your application less efficient, and you may face higher development costs to set up the background notification service.
Node.JS provide a module called SOCKET.IO. I use this in my android apps for live messaging. You can configure it on AWS, Digitalocean Or you can use Heroku.
Here is the good example of Socket.io with android http://nkzawa.tumblr.com/post/46850605422/connecting-to-a-socketio-server-from-android
Android chat app wit socketio
https://github.com/nkzawa/socket.io-android-chat

How to implement a TAPI solution with Avaya

I currently have a working CTI integration on a Samsung phone system, within our business. Our desktop clients are running bespoke java clients which receive messages from our bespoke server application which connects to the Samsung DCS System.
We are getting a new Avaya phone system in shorty and I want to get this to work with our existing desktop client system. Therefore, I do not wish to install anything new on the desktop clients. I want to write a replacement server application that connects to the Avaya, and then uses the current message process from server to client.
Can someone please let me know what API I should be looking at to write this server based application. It must be Java based.
The two key things required are;
1. The server must be notified of all numbers ringing on all phones, so t can message the relevant client.
2. The server must be able to dial a number, on behalf of client phone, to an external number.
Any pointers in the right direction would be appreciated.
The API you need is JTAPI; you can find the documentation for it on Avaya DevConnect website: http://devconnect.avaya.com. You will need to register there but it's free.
You can also use the Avaya Device, Media, and Call Control SDK (DMCC) which is a newer, fully functional API covering media, monitoring, and advanced call control operations. See for more information https://devconnect.avaya.com/public/dyn/d_dyn.jsp?fn=353.
This API is hosted off of the Avaya Aura AE server (AES) which is deployed with Avaya Communication Manager. AES hosts a number of different API including TSAPI and Web Services. Investigate this platform and see if it meets your needs.

java implement google checkout serial-number notification

I want to implement serial-number notification for google checkout as I do not have a domain name but a static ip. I have gone through Implementing the Notification XML API of google checkout and what I have understood is that there are two ways to get notifications:
1.) Have a SSL certificate on server and provide a URL in google checkout account and google will send either XML or HTML notifications on that URL.
2.) Google sends serial-number notification to our application and then that serial-number is used to get other notifications from google.
Now my question is that in case 2 above we do not need a SSL certificate to get serial-number notification. But when application uses serial-number to get other notifications using Notification History API then at that time also server do not need to have SSL certificate or will it be necessary to have a SSL certificateget to get other notifications.
Also can you please provide me some links or sample codes to implement serial number notification in java.
Correct on (1) and (2) - these are you 2 options.
You do not need SSL certificate for your handler if you implement Serial Number Notification.
Another difference between (1) and (2) is that Google will not send Basic Authentication headers to your handler in Serial Number Notification (they do for XML and name/value).
The latter part of your question, JAVA code sample isn't something I can help you with (am .Net). Perhaps this tutorial can help - it also mentions their Java SDK.

Categories

Resources