PHP-GCM PHP sent to device

Source: Internet
Author: User
Keywords PHP Android
Phpandroid

For a GCM issue, send the message to all mobile devices:

Php:

$resultcoment = mysql_query("SELECT * FROM notificaciones");while ($row = mysql_fetch_array($resultcoment)){$result = '"' . $row['regId'] . '", ';//print_r($result);$registrationIDs = array($result);}$message = $_POST['message'];$fields = array(            'registration_ids'  => $registrationIDs,            'data'              => array( "message" => $message ),            );

Results:

"Apa91bhmihsncsg_yvhyzmprrxmw-e_ Iy7bpa9bo934n67afw8hxjhzvm1mnhrpartn6xbkxvjz9t9yfh9qni0zm5b9cpgxdhrkhystxyrwtrld02lq-v_e4zwkigghqt4bph_ Zlnggaau6hwo8ny8mm2_d7glekwckkzdnhwfo5hxghwf4gbzm "," Apa91bhmihsncsg_yvhyzmprrxmw-e_ Iy7bpa9bo934n67afw8hxjhzvm1mnhrpartn6xbkxvjz9t9yfh9qni0zm5b9cpgxdhrkhystxyrwtrld02lq-v_e4zwkigghqt4bph_ Zlnggaau6hwo8ny8mm2_d7glekwckkzdnhwfo5hxghwf4gbzm "," apa91belwwgutnoi3yrrunj_ Bbaacdc4pascb3lxcfwqm9ralqe0hc0c1xvf-eir7ilyflbemdjnmpy-503fqzopajjt514zo1j86uhuobhlu79pktvzjmxibavoiucasky__ JVTBQALVMZ8NJTZZRG81TF1-SVTJW "," apa91belwwgutnoi3yrrunj_ Bbaacdc4pascb3lxcfwqm9ralqe0hc0c1xvf-eir7ilyflbemdjnmpy-503fqzopajjt514zo1j86uhuobhlu79pktvzjmxibavoiucasky__ Jvtbqalvmz8njtzzrg81tf1-svtjw ", {" multicast_id ": 8410297698153738741," Success ": 0," failure ": 1," Canonical_ids ": 0," Results ": [{" Error ":" Invalidregistration "}]}

How could that be?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.