How can i send JavaPNSpayloads using PushMagic token - ios

Hi i am implementing IOS MDM using JavaPNS. Steps performed up to now.
1)I installed xxx.mobileconfig file on IOS Device.
2)I am using JavaPNS for sending notifications.
3)I got PushMagic token from my IOS Device.I got 200 Response.
4)I am using https:// for checkin url. I am using IPCU for generating mobileconfig files.
5)My intension is install some custom payload like disable the camera,disable the youtube ..etc.
6)I am using Restriction payload for that .I am sending the push notification but the IOS Device cannot responding to my server...
The following issue seems to be my issue so can any one guide me.
http://code.google.com/p/javapns/issues/detail?id=103
Any advice would be appreciated.

Try the following
Download and install iPhone Configuration Utility.
Connect your device and open console tab
Send a command from server to the device and see logs (see image below)
If you can see traces of MDM in the logs such as starting, polling etc, that means the device has received the APNS message and is trying to connect to the MDM server for commands.
If in the console you find some error, you need to further investigate.
If you don't see any traces of MDM in the logs, then probably there's some issue - either with the server (invalid push token etc) or with the device's internet connection.
Please post the results and ask for more details if required.

Related

Twilio Device Cannot Be Connected : Twilio Js

I have an issue regarding Twilio Javascript SDK and stuck in a
situation where the issue directly involve IOS and RTC support. Right
now, i cannot connect the twilio device after device is ready. There
is no error or anything to track/debug.
Constantly, running the connection.status() return back connecting always. I think the signaling system works when there is an incoming call but again, connection.accept() and status remain connecting like forever.
Application Overview
Cordova/Phonegap app
https://media.twiliocdn.com/sdk/js/client/releases/1.6.9/twilio.min.js
shim:https://webrtc.github.io/adapter/adapter-1.0.2.js
https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc
Possible reasons: Can this be directly CSP issue? or I have you setup configuration using STUN/TURN?
Let me know if you need any information. It's not going to resolve because there is no error just "connecting" status.

Twilio incoming calls not working for iOS

I'm really lost here.
At first, all calls between iOS-Android, Android-iOS, Android-Android and iOS-iOS, was working. Even so I still was getting errors like:
52143 - The push notification was rejected by APNs
52134 - Invalid APNs device token
But since was woking I ignored those errors.
Now, I had to change the client app to a new account - Apple and Google. And all start to fall apart.
I've already lost how many times that I deleted and create all the Apple Certificates and upload them to my Twilio account.
Right now, I have VoIP Apple Certificate working on production only from iOS to Android calls, but still getting those creepy erros.
And, if I run my APP and API all in LOCALHOST with the same Twilio Config and Apple Certificates, it all work beautiful except for those erros (52143,52134) that keep coming.
So... what could I be missing here?
This could be related:
https://github.com/twilio/voice-quickstart-objc/issues/33
https://github.com/twilio/voice-quickstart-swift/issues/34
https://github.com/twilio/voice-quickstart-objc/issues/115
https://github.com/twilio/voice-quickstart-swift/issues/142
https://community.clevertap.com/t/ios-error-apnsdevice-token-not-for-topic/545/3

How to test Apple Push Notifications Feedback Service?

What I did as a test is following:
I made example app where I enabled push notifications and implemented mechanism for handling them.
I was testing sending of silent push notifications to my app with curl and that works pretty well. I am testing that with:
curl -v -d '{"aps":{"content-available":1}}' --cert "/Users/me/Desktop/mycert.pem":"" -H "apns-topic:com.domain.name" --http2 https://api.development.push.apple.com/3/device/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
As an answer from Apple, I am always seeing following:
< HTTP/2.0 200
< apns-id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX
Which is fine and as expected, according to Table 6-4 from the official docs: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html
Now I delete the app from my device and I retry the same request kinda hoping that I will start getting status code 410 and info that The device token is no longer active for the topic. How ever, that doesn't happen and I am always getting 200 status code like everything's fine and that the push token is still available.
1 - 1.5 hours after deletion, I am still getting 200 as an answer.
Do you maybe know how often does Apple refresh push tokens list and when I can expect to eventually start getting 410? And also - is 410 status (and Instant Feedback in general) testable at all while testing the app outside of production environment?
Thanks in advance for any kind of answer.
Cheers
Okay, so from what I have discovered, seems that Instant Feedback service from Apple is working just fine and is able to detect uninstall pretty fast. There was a small trick in how to test these things properly with sandbox service.
If you make an app which you are testing locally on your device and your app is the only one installed on your phone from that provisioning profile (vendor), stuff which I faced as an issue in my question will be encountered. For some reason, even if you uninstall the app (which was the only one on the phone installed from your provisioning profile), Apple is always responding with 200.
What needs to be done is following: After you install your app which you are testing, create a new dummy app with another bundle ID, but which also coming from your provisioning profile, enable push notifications in it as well and install it on your device. So now, you have two apps that you made - one which you are developing and testing the Instant Feedback service with and another one which kinda "zombie" app which just sits in there and does nothing.
After this, uninstall your test app, try to send silent push notification and Apple will respond with status code 410 as expected.
Dummy way, but for some reason that's how it should be while testing. Behaviour in production should be as expected and w/o any need to have a dummy (or any other) app from same vendor installed on iOS device.

PushSharp : The maximum number of Send attempts to send the notification was reached! on client server

I am using PushSharp to send push notifications and getting the error 'The maximum number of Send attempts to send the notification was reached!'.
The interesting thing is that from my local server notifications are sent successfully, but when I run on Client Server I am getting above error.
At the this link https://github.com/Redth/PushSharp/issues/462, I see you resolved this issue. with the following tricks.
Exported Apple Developer & Distribution Certificates as *.p12 from Keychain of Mac (No Private Keys)
Added the certificates to the windows keychain of server under personal & trusted roots to match the certs being loaded for the push channel settings
Extended the max re queue property value of service settings to 25, the default is 5
I follow the above, but still issue persists. Any Idea or another way to resolve it ?

Push Notifications stopped working after move to Amazon ec2 server

I've been testing my iPad app with ad-hoc distributions.
On our server (running Windows Server 2008) APNS alerts come through fine.
On the ec2 (also running Windows Server 2008) they never arrive.
The only difference between the two ad-hoc versions is the server they point to. Both have the same code-signing settings.
I followed the same procedure for importing certificates on both servers and as far I can tell the certificates are exactly the same on both servers.
I've also opened ports 5223, 2196, 2195 & 443 and allowed the 17.0.0.0/8 address block:
I even tried turning off the Firewall but no joy and I still can't figure out why it works on one but not the other.
Anyone have any ideas?
-EDIT-
I'm using MoonAPNS to handle sending the notifications via a C# / ASP.Net web service. Don't know if that makes any difference.
Push notifications with EC2 work great. Used/implemented it in a couple of apps. Here's a couple of things to check
Do you get an error when connecting to the APN servers? Try using $ telnet gateway.push.apple.com 2195. Does it work? In case it doesn't you might need to make changes to the security group/open the necessary ports
If the server says the message was sent successfully, but you don't receive it in the app, make sure you check the mobileprovision and pem files you are using
Since you mention telnet works and you have checked the pem and mobileprovisions, a few other things to check
Do you get any errors when MoonAPNS tries connecting to the APN servers?
If no errors are returned, did you check if the device tokens were stored in your database and it was your test device's token?
If messages are being sent out ok, did you ping feedback services? Do they return an error for a specific device token (i.e. your device)?
It turned out to be nothing specifically to do with the Amazon ec2 but rather something that not only should've been obvious but that I've also had an issue with before.
I'm using MoonAPNS and the problem was the first parameter in this line:
PushNotification push = new PushNotification(true, certificate, password);
The true parameter tells MoonAPNS to send the notification to Apple's sandbox server.
false tells it to send to the production server.
I had false on our own server and true on the Amazon ec2.
Both are now false and the notifications are at last coming through from the ec2.
Thanks to everyone for your efforts.

Resources