Download
Using this library you can send APNS "wake up " to many devices.
**********Please follow these steps to implement it.****************
1.Initialing with certificate-location and password
APNSInitiator apns=new APNSInitiator("/home/mayuran/ workspace/IOSMDM/src/ certificates/MDM_ WSO2 Inc_Certificate.p12", "pasword");
Note:Here you push certificate should be in .p12 format with its respective password.
Note:Here you push certificate should be in .p12 format with its respective password.
2.Calling the method to push
apns.pushingToAPNS( devicesInfoList);
Note: Here devicesInfoList is the set of devicetokens,magictokens .
example :
[{magictoken=7DDAFFA8-B282C- 45CB-B3C2-7B71850F1803, devicetoken= L6lUGSrOIx5jnHtQgAWqBELzpkXhGe xWiHVHfC2fzwZ8=}, {magictoken=7DDAFFA8-B82C- 45CB-B3C2-7B71850F1803, devicetoken= L6lUGSrOIx5jnHtQgAWqBELzpkXhGe xWiHVHfCfzwZ8=}]
additional information :
you can create devicesInfoList by
put("devicetoken", "L6lUGSrOIx5jnHtQgAWqBELzpkXhGexWiHVHfCfzwZ8=");
put("magictoken", "7DDAFFA8-B82C-45CB-B3C2-7B71850F1803");
}};
ArrayList<Map<String,String>> devicesInfoList = new ArrayList<Map<String,String>>(10);
devicesInfoList.add(device1 Attributes);
devicesInfoList.add(device2 Attributes);
Thank you for your post. But could you tell me, what are the device token and magic token? Device UUID and ???
ReplyDeleteOnce you enrolled ,the device sent you Device token ,Pushmagic token
DeleteHere
Device token : using this push notification will reach the device.
Push magic token : using this MDM client authenticate the push notification and allow APNS to trigger the MDM system.
Device UUID : Since device UUID unique to each device,it helps you map the service calls to devices .
For example 1000 devices are trying to connect to your MDM system at the same time.In this case you can send(to a device) a UUID in the request payload and get the same UUID in response payload (from device).
So easily you can differentiate and mange service calls to devices.
I hope now you can understand :)
Thank you for your quick reply, Mayuran!
DeleteI'm studying MDM with only documents because I'm waiting a Enterprise account.
Could you have a post for how do use javapns to send a command to APNS? I searched a long time on Google, but only see posts for sending a notification, not MDM command.
Thank you so much!
same as ANPS app push notification service , MDM also use same service with little modification on it .
DeleteI explain what to send to APNS server for MDM support.
Please refer
Tried the above piece of code but device is still not being able to receive notifications.I have both pushmagic and device token value coming from the device.
Delete@deepti you must probably check for your APNS certificate and password.
DeleteI hope you made the devicesInfoList as show above.
FYI this is a working code and pretty straight forward
Hi. I have a question.
ReplyDeleteIf i want send a particular command via MDM, for example "DeviceLock", how can i do this?
this is the code for push : ApnsNotification goodMsg = svc.push(goodToken, payload_MDM);
but where i can insert the command for lock the device??
many thanks in advance!
Good question !!
DeleteYou must know first how apple constructed MDM flow.
Actually you don't send a device control command to APNS (example device lock).
You will use the APNS payload to "wake up" the device ,
Remember we send only device Device token(to find device), push magic token(authenticate MDM capabilities on your device) to APNS server.
So the APNS finds the device using token and wake up the device.
Once device wake up , it will request to your server (server url) for any pending CONTROL commands.Server in response sends control commands like wipe , lock , etc to the device.
here server url, you supposed to mention during the enrolment.
Let me know if you have doubts in that
Thanks for the answer!
DeleteSo, if i want send a Control command, first, i must "wake up" the device via APNS, then, the device "ask" if the server have some control command. (of course the device know the server address after the ernollment phase).
And here the server send the command throught a a xml file (plist).
It's correct?
yes..you are right...server can send all the payloads (lock,wipe,wifi,vpn,apn,etc) in a plist file(xml formatted).Once device receives the payload,it will execute immediately.
DeleteThank you very much!! :)
DeleteDo you have any information( or document) about the new features for MDM with IOS 7(and IOS 7.1)?
DeleteThanks in advance:)
i think you have to check this site for iOS7 added mdm features.
Deletehttp://www.apple.com/sg/ios/business/
Thanks. I would like to find some papers or detailed information about this new features , but inside the Apple site i can't find nothing . Usually there are very stingy about infromation.
ReplyDeleteBut very thanks. ;)
lol yea Apple dont give enough info to developers as usual.
ReplyDeleteI have done MDM about a year ago.that time was iOS 6.
Later they released iOS 7 with MDM features Per app VPN , SSO , open in management. It seems very interesting things happening in enterprise MDM world.
I think you must put your question in apple developer forum and get solutions to your needs.
Good luck :)
Thank you ;) I have a last doubt, i hope that you can answer ;)
DeleteIf i install a profile with, for ex., only youTube, and before the installation i have , for ex, only Facebook, after the profile instalaltion, of course,i don't see facebook more.
But the application has been uninstalled or was deleted just the logical link with the app, and there still stay on the phone??
Very thanks ;)
well..it happens only in configuration profile installation, which can replay the exiting configuration profile , if you try to install a new one.
DeleteSo first configuration profile contains (ex. Camera disabling) can be removed / replaced with new one.so you do not see any configuration installed through the first config file.
Very thanks for your answer....;)
Delete