i have studied and implemented Ray wenderlich's awesome tutorials on apns, and i am using this php script on server side
https://github.com/sebastianborggrewe/PHP-Apple-Push-Notification-Server
every thing is going well, but i just want to know that how can i send push notification in a language other than english, like arabic, urdu, hindi or french...???(i am sending notifications from php server using a web form) this is first part of question, the other part is that can i send a voice message with push notification, i know that there is a property for sound in apns but dont know its max. length (max length of push notification is 256 bytes). plz. guide me thanx and Regards Saad.
Sound support is limited to playing audio files of the app (you include PushSound.aiff in your app and send "PushSound.aiff" in your apns-message.. that's all you can do!)
For localization, you [need to include localized strings in your app and then include the String-Key(ID) in the push message.
You should read the guide apple provides for all questions regarding push notifications
To add localized strings, you can add a strings file (file->new, select iOS/Resource->Stringsfile; name it Localizable.strings). You can add format strings ("%# has sent you a new message") and supply the format string's arguments in the push notification (see guide).
Again there is a internationalization guide
Related
I would like to add a "Text Me" form to my website that will allow users to type their Name, Phone Number, and a Message that i receive on my phone via SMS. I would prefer something easy and free, perhaps a code snippet. Does anybody have any suggestions for a "Text Me" form or a service that provides one?
A quick google-search reveals (at least for German) customers: lox24.eu - they have a VERY simple way for sending SMS:
https://www.lox24.eu/API/httpsms.php?konto=<yourId>&password=<yourPassword>&service=<yourTariff>&text=<SMSText>&from=<yourSender>&to=<receivingNumber>
All you have to do, would be creating a short text from the $_POST variables of your form and then do a HTTP-request (preferrably cURL) from within the PHP-page that receives the form-data.
You might try to google for "websms api" to find a SMS-gateway in your country that provides the services you need.
HTH
^KMP
I recommend If This Then That. You can hit a simple web backend, supplying a JSON payload, and IFTTT will then send an SMS to your cell with the payload text, or whatever text you want.
Maker channel: https://ifttt.com/maker
SMS channel: https://ifttt.com/sms
IFTTT will abstract away the specifics of how the text is sent (doesn't matter what carrier, what country, etc.) and it will (probably) break the text into properly sized chunks. If not, you might have to do that yourself, though - just use substr() to divide the text payload into chunks of 160 characters and hit the backend as many times as necessary for the message to be sent.
You can use raw cURL to hit the backend, but I find that Guzzle is a great PHP library for making web requests of any kind.
A lot of mobile carriers in the US (not sure about abroad) will have a text equivalent email. For example, AT&T will text you if you send an email to yourmobilenumber#txt.att.net. Its free.
I'm a bit confused here and due to the keywords involved Google has not been much help. I want to send text messages from my website to users with cellphones via SMS. Sounds simple enough using things like 1234567890#carrier.com with php mail scripts right? Well one thing I've encountered before is that sometimes it sends an MMS(multimedia message) instead of a regular text message.
What I am trying to find out(using keywords in Google, send text message phone number php) is how to get a phone number for your website? I've seen sites that actually have a phone number linked to the site that you can receive messages from.
Example Facebook uses 32665 to send and receive messages on.
How do you accomplish this?
Is it any way possible using the 1234567890#carrier.com with php mail to strictly only send a text message and not multimedia?
Example php mail script using a phone number:
<?PHP
mail("5558349324#vtext.com", "", "Test SMS", "From: RRPowered <test#rrpowered.com>rn");
?>
Also thanks to any help ahead of time, because I am really really confused at this point.
UPDATE: I just tried using the regular PHP mail functions to a phone number and it appears to cut the messages off at around 140 characters(I believe that is standard message size).
UPDATE 2: Before anyone mentions API like Text Magic, I am aware of those things, BUT I am wanting to build my own code instead of integrating someone elses API(if possible).
I'm using Asterisk with chan_dongle (and Huawei UMTS stick) on Debian Wheezy. I can send and receive SMS successfully. The 7-bit de/encoding work is done by a simple PHP script.
My problem is, that I can't receive concatenated SMS. This is the Base64 text from two different messages:
Ym9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVX
WHNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVtBYm9LZWl1a1NfYUNnSU1PUVVXWXNxR21FXVs=
CENdV0tBTH1lQUhLU11LQShLU1ldQ1FbS0FCXUFIS2VBYENzZ0NNS0dDZUlbAldpU19dXUAIS1NdS0FgS2VneV1ZU0dRS0FgQ3NnQ01LR0NlSUEEX11rZ0EgEx1BUGpACislU0BYQ2tpS2l1QEBgcGBsQGxyaHJAaHJiYkBubGBkdkAmS2VTS11da1tbS2V1cmJiZmxsbmxo
XEAOfVlpU09BRFNnQWZiXGBwXGRgYmhcAA==
The first one is a simple repeating "qwertz..." dummy text, sent from my Android phone.
The second one is a (German) reply from a service provider with a coupon code.
The first one looks easy to decode. 7/8 bit magic and we're done.
But the second one is really strange. Any ideas how to decode it?
There is only way to deal with multipart SMS is working as PDU with it and concatenating in your application.
i have an iphone 3g and can successfully send text messages using the PHP mail() function. My issue is that for each message i receive, the "telephone number" associated with the incoming text message changes each time. If possible, I would like to somehow make this number constant so that I can take advantage of iphone's ability to aggregate all text messages from the same telephone number -Otherwise my iphone would be cluttered with messages. Is there a way to do this?
an example of the numbers I receive would be 1(410) 000-001, 1(410) 000-002, 1(410) 000-003, etc... can i make this constant somehow?
$message = stripslashes("new user just joined!");
mail("8185551111#txt.att.net", "Subject", "$message");
please let me know! thanks...
This is likely more to do with ATT than your PHP code.
This is a limitation of the carrier's email-to-SMS gateway. There's no way to guarantee which number the message will come from.
SHAMELESS PROMO: You could use a service like Twilio (whom I work for) and get a phone number for $1/month which you would be able to always send from. There's a ton of PHP sample code to get you started. There are other SMS APIs out there as well so look around and find the one that you like best.
HI All,
Has anybody been able to extract the device tokens from the binary data that iPhone APNS feedback service returns using PHP? I am looking for something similar to what is been implementented using python here
http://www.google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#m5eOMDWiKUs/APNSWrapper/init.py&q=feedback.push.apple.com
As per the Apple documentation, I know that the first 4 bytes are timestamp, next 2 bytes is the length of the token and rest of the bytes are the actual token in binary format. (http://developer.apple.com/IPhone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW3)
I am successfully able to extract the timestamp from the data feedback service returns, but the device token that I get after i convert to hexadecimal using the PHP's built in method bin2hex() is actually different than original device token. I am doing something silly in the conversion. Can anybody help me out if they have already implemented APNS feedback service using PHP?
TIA,
-Anish
PHP technique to query the APNs Feedback Server
The best place to go for this is actually the Apple developer forums in internal to the iPhone portal - the have a bunch of examples in different languages for working with these push requests.
I'm also currently at an 360iDev push session, and they noted an open source PHP server can be found at:
http://code.google.com/p/php-apns/
Once you have your binary stream, you can process it like this:
while ($data = fread($stream, 38)) {
$feedback = unpack("N1timestamp/n1length/H*devtoken", $data);
// Do something
}
$feedback will be an associative array containing elements "timestamp", "length" and "devtoken".