I have own push notification system, but I would migrate to Urban Airship. I have list of users with device token. Can I import my users database with device token to urban airship and how can I make it?
Asked
Active
Viewed 812 times
3
-
Technically speaking, you can. – yibuyiqu Aug 22 '13 at 07:46
2 Answers
0
According to https://support.urbanairship.com/customer/portal/articles/1069013-helpful-curl-examples Android and Windows device registration must happen from client library embedded in application, and you cannot manually register an Android or Windows APID via the API. On iOS it is possible using curl. Check the examples from the link at Device Registration

bogdanh
- 66
- 1
- 3
0
You can import device tokens from your own system to Urban Airship through UA APIs. here is PHP code for this purpose.
foreach($device_tokens as $device_token) {
$register_url = 'https://go.urbanairship.com/api/device_tokens/'.$device_token.'/';
$session = curl_init($register_url);
curl_setopt($session, CURLOPT_USERPWD, $app_key . ':' . $app_master_secret);
curl_setopt($session, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($session, CURLOPT_HEADER, False);
curl_setopt($session, CURLOPT_RETURNTRANSFER, True);
$content = curl_exec($session);
// Check if any error occured
$response = curl_getinfo($session);
if($response['http_code'] != 200) { // bla bla $response['http_code']}
}
curl_close($session);

HiZaib
- 696
- 7
- 15