Is about php script
how can I handle with many device tokens?
I have tried to use an array but didn’t work :S
someone knows a way to handle with many device tokens?
Thanks [import]uid: 23063 topic_id: 19561 reply_id: 319561[/import]
Is about php script
how can I handle with many device tokens?
I have tried to use an array but didn’t work :S
someone knows a way to handle with many device tokens?
Thanks [import]uid: 23063 topic_id: 19561 reply_id: 319561[/import]
Hi, this is some php that works on my local server sending to all the device tokens I have scraped from devices. Lets assume you have a mysql database called ‘tokens’ full of all your tokens.
They are stored in a table in that database, again called ‘tokens’. The field the tokens are stored in is called ‘token’. So you have tokens(database) => tokens(table) => token(field).
Here is the php to select all the tokens and send each one a message you defined earlier on, under the variable “$message” which you got using GET.
[php]
<?phpthank you so much i will try your code
Thanks [import]uid: 23063 topic_id: 19561 reply_id: 75621[/import]
another question… how can I fire this php? To work
in terminal we can do this by
“php sendpush.php”
but in webserver, how can we “fire” this php?
Thanks [import]uid: 23063 topic_id: 19561 reply_id: 75641[/import]
if you have xammp or similiar running, just get to it via your browser, i.e
localhost/test.php
[import]uid: 24641 topic_id: 19561 reply_id: 75642[/import]
If you have on a server somewhere, just hit it with your browser:
http://yourwebsite.com/sendpush.php
[import]uid: 19626 topic_id: 19561 reply_id: 75662[/import]
http://universopositivo.com.br/iphone/sendpush.php
didn’t work :S
I put my ck.pem into the same folder where sendpush.php are
but it don’t work
[import]uid: 23063 topic_id: 19561 reply_id: 75668[/import]
more often that not localhost won’t work on a remote server, look up on your Cpanel the mysql details [import]uid: 24641 topic_id: 19561 reply_id: 75684[/import]
but I’m not using your script yet
[php]
<?phpanyone? [import]uid: 23063 topic_id: 19561 reply_id: 77300[/import]
Put some “echo” statements in your PHP script to print what its doing.
Look into using EasyAPNS
[import]uid: 19626 topic_id: 19561 reply_id: 77311[/import]