Android Push Notification of the New GCM release using Coldfusion

Is there any similar push notification solution/Tutorial but this time for the Android?
Something similar to this tutorial but with Android GCM using coldfusion to send from my dedicated server to the registered devices:
http://www.raymondcamden.com/index.cfm/2010/9/13/Guest-Post-Apple-Push -Notifications-From-ColdFusion-in-Ten-Minutes-or-Less
Thanks in advance
Talal

well after diving and testing here and there I found a way and successfully tested.
1> First and formost, the developer need to follow the procedures in this page:
http://developer.android.com/guide/google/gcm/gs.html
2> In the app side, you will send users devices information; but all that matters is only the "registration id" , so make sure you save this in the database coz you'll use it to loop through your database records when sending notifications.
3> Now the server side script in Coldfusion which is really easy:
<!---Place this above your html tag--->
<cfsetting requesttimeout="80000000000000">
<cfset appName = 'YourAppName'>
<cfset registrationArray = ArrayNew(1)>
<cfquery datasource="devicesDSN" name="rsCount">
    SELECT COUNT(intGCMuserID) AS TotalRecords
    FROM gcmusers_tbl
    WHERE appName = <cfqueryparam cfsqltype="cf_sql_clob" value="#appName#">
</cfquery>
<!---Google is limited to send only to 1000 devices at a time so we need to nest the cfloop of the array inside another cfloop pertaining to our total recordCount from the recordset so we'll use the Ceiling to control the number of loops needed to make sure we sent to all the users if they exceed google limit--->
<cfset LoopingNo = Ceiling(rsCount.TotalRecords/1000)>
<cfset fromRec = 1>
<cfset toRec = 1000>
<!---Now place the following code inside the body tag of your cfm page--->
<cfif isDefined("FORM.pushButton")>
    <cfquery datasource="devicesDSN" name="rs">
    SELECT regID
    FROM gcmusers_tbl
    WHERE appName = <cfqueryparam cfsqltype="cf_sql_clob" value="#appName#">
    ORDER BY intGCMuserID DESC
    </cfquery>
    <cfloop from="1" to="#loopingNo#" index="i">
        <cfloop query="rs">
            <cfset ArrayAppend(registrationArray, "#regID#")>
        </cfloop>
        <cfset stFields =
        { "data"= {
            "title" = "#FORM.title#",
            "message"= "#FORM.message#"
          "registration_ids"= #registrationArray#
        >
        <cfhttp url="https://android.googleapis.com/gcm/send" method="post" result="httpResp" timeout="600">
            <cfhttpparam type="header" name="Content-Type" value="application/json"/>
            <cfhttpparam type="header" name="Authorization" value="key=yourAPIkeyFromGoogle">
            <cfhttpparam type="body" value="#serializeJSON(stFields)#">
        </cfhttp>
        <cfset temp = ArrayClear(registrationArray)>
        <cfset fromRec = fromRec + 1000>
        <cfset toRec = toRec + 1000>
    </cfloop>
    <h2 align="center" style="color:red;">Sent to: <cfoutput>#rs.RecordCount#</cfoutput> Devices/Users </h2>
    <h3 align="center"><a href="thispage.cfm">&gt;&gt;&gt;again</a></h3>
<cfelse>
<cfform>
  <table width="400" border="1" align="center" cellpadding="2" cellspacing="2">
    <tr valign="top">
      <th scope="row">Title:</th>
      <td><label for="title"></label>
      <cfinput type="text" name="title" required="yes" id="title" maxlength="30" width="300" message="Type Title"></td>
    </tr>
    <tr valign="top">
      <th scope="row">Message:</th>
      <td><label for="message"></label>
      <cftextarea name="message" cols="45" rows="2" required="yes" id="message" maxlength="120" message="Type Message"></cftextarea></td>
    </tr>
    <tr>
      <th scope="row"> </th>
      <td><cfinput type="submit" name="pushButton" value="send" id="pushButton"></td>
    </tr>
  </table>
</cfform>
</cfif>

Similar Messages

  • I can't get any push notification with the NEW IOS7 what should i do?

    I am getting so angry at not being able to get any push notifications! what should i do?

    Try:
    - The troubleshotting here:
    notifications are not showing: Apple Support Communities
    - notifications are not showing: Apple Support Communities

  • Android Push Notification

    Is the a way for Android Push Notifications?

    The notification would be for sending notifications about new issues or updates of the magazin. Now there is no way to inform the readers - or are there other ways?!
    best jan

  • Getting old push notifications along with new push notifications..

    I was Getting old push notifications along with new push notifications for the app.
    from server side we made sure we are not sednig again the old notifications.
    Any help on this ?
    Thanks inadvance...

    Having the same problem and wide scale here.

  • Android Push Notifications Support

    Hello All,
    I found what I was looking for here: Android Push Notification
    But I wanted to follow-up a bit further and see if Android Push notifications will be implemented at some point? Thanks.

    We'll we'd like to send out notifications just like we do for iOS so we can
    re-engage the user after they stop viewing our app. For example, if we'd
    make a significant change to an articles we'd like to promote it letting
    the users know.
    On Mon, Sep 8, 2014 at 11:00 AM, Neil Enns - Adobe <[email protected]

  • I like the new rapid release, but I don't like how it's done.

    Hello Firefox users.
    I have a suggestion for your rapid release program. Ever since Firefox 2, I have been a loyal fan. Each update had a meaning and a purpose.
    Ever since Firefox 5, each update makes slight improvements to technologies that aren't even used by the majority of the web. I'm not criticizing the updates you give, but instead how they are delivered.
    Since Firefox 5, every 6~ weeks, a new firefox is released with a new version number. They offer little new.
    My suggestion is to stop increasing the main version number.
    When you go to your Firefox version, it says Firefox 7.0.1. At the this rate, the second digit of the firefox version will likely NEVER be used. How can they give a decent update in less than 6 weeks? That wont happen, they will include it in the next release.
    Instead I propose a slightly revised plan. Instead of increasing the main version number, increase the second version number.
    For example;
    Firefox 8 is coming out very soon, instead of releasing it as Firefox 8, instead release it as 7.1. Firefox 9 can be released as 7.2. Firefox 10 can be released as 7.3, and etc.
    Based on the old plan (before rapid release) a MAJOR update would be released very rarely. Example:
    Firefox 2.0 released October 24th, 2006
    Firefox 3.0 released June 17, 2008
    That's about '''1 3/4 years later'''! In that same time span, Firefox will have increased 15 version numbers! That means '''we will be at version 22 in 1 3/4 years'''!
    I am in no way suggesting reverting. The new rapid release helps get new technologies out there.
    Here is my plan:
    * Firefox 7.1 (8) Week #6
    * Firefox 7.2 (9) Week #12
    * Firefox 7.3 (10) Week #18
    * Firefox 7.4 (11) Week #24
    * Firefox 7.5 (12) Week #30
    * Firefox 7.6 (13) Week #36
    * Firefox 7.7 (14) Week #42
    * Firefox 7.8 (15) Week #48
    * '''Firefox 8.0 (16) Week #54'''
    The six week plan with incremental updates will give us Version 8 on Week 54, almost one year after Version 7. This will allow for technologies to be released without undermining the huge progress that was made from version Firefox 1.0 - 4.0.
    This will stop the large amount of complaints that Firefox has been receiving.
    The rapid release that Chrome uses works well because they started with it, and they are used to it.
    I hope Firefox will consider this plan instead of the old one. I cannot see any flaws in it, but if you can, '''please''' point them out, as I would like to either rebuttal them, or agree with them.

    They do, just may not seem to be as obvious or as big as the the Firefox 4.0 release was in abundance of features.

  • Error after installing the new JSF release

    I've got a problem to install the new JSF release. I downloaded the Web Services Developer Pack 1.3 from the homepage and installed it. Then, i downloaded the actual release of the JSF 1.0 as a zip file. I removed the existing jsf directory in the original WSDP and extracted the zip file into the home directory of the WSDP. Then I renamed the directory from jsf-1.0 to jsf and started the tomcat again.
    But then I get the following errors and tomcat isn't working at all:
    Mar 19, 2004 1:43:52 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on port 8080
    Mar 19, 2004 1:43:52 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 3297 ms
    Mar 19, 2004 1:43:52 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Java Web Services Developer Pack
    Mar 19, 2004 1:43:52 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Java Web Services Developer Pack/1.3
    Mar 19, 2004 1:43:52 PM org.apache.catalina.core.StandardHost getDeployer
    INFO: Create Host deployer for direct deployment ( non-jmx )
    Mar 19, 2004 1:43:53 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:H:\jwsdp-1.3\conf\Catalina\localhost\jwsdp-catalog.xml
    Mar 19, 2004 1:43:54 PM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Skipped installing application listeners due to previous error(s)
    Mar 19, 2004 1:43:54 PM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    Mar 19, 2004 1:43:54 PM org.apache.catalina.core.StandardContext start
    SEVERE: Context startup failed due to previous errors
    Mar 19, 2004 1:43:54 PM org.apache.catalina.logger.LoggerBase stop
    INFO: unregistering logger Catalina:type=Logger,path=/jwsdp-catalog,host=localhost
    Mar 19, 2004 1:43:54 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:H:\jwsdp-1.3\conf\Catalina\localhost\jstl-examples.xml
    Mar 19, 2004 1:44:03 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:H:\jwsdp-1.3\conf\Catalina\localhost\jsf-cardemo.xml
    Mar 19, 2004 1:44:14 PM com.sun.faces.config.rules.NavigationRuleRule end
    WARNING: [NavigationRuleRule]{faces-config/navigation-rule} Merge(/confirmChoices.jsp)
    Mar 19, 2004 1:44:16 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:H:\jwsdp-1.3\conf\Catalina\localhost\jsf-nonjsp.xml
    Mar 19, 2004 1:44:27 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:H:\jwsdp-1.3\conf\Catalina\localhost\jsf-components.xml
    Mar 19, 2004 1:44:40 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:H:\jwsdp-1.3\conf\Catalina\localhost\jsf-guessNumber.xml
    Mar 19, 2004 1:44:52 PM com.sun.faces.config.ConfigureListener verifyObjects
    INFO: Application object verification completed successfully
    Mar 19, 2004 1:44:52 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:H:\jwsdp-1.3\conf\Catalina\localhost\admin.xml
    Mar 19, 2004 1:44:53 PM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Skipped installing application listeners due to previous error(s)
    Mar 19, 2004 1:44:53 PM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    Mar 19, 2004 1:44:53 PM org.apache.catalina.core.StandardContext start
    SEVERE: Context startup failed due to previous errors
    Mar 19, 2004 1:44:53 PM org.apache.catalina.logger.LoggerBase stop
    INFO: unregistering logger Catalina:type=Logger,path=/admin,host=localhost
    Mar 19, 2004 1:44:53 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:H:\jwsdp-1.3\conf\Catalina\localhost\manager.xml
    Mar 19, 2004 1:44:54 PM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Skipped installing application listeners due to previous error(s)
    Mar 19, 2004 1:44:54 PM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    Mar 19, 2004 1:44:54 PM org.apache.catalina.core.StandardContext start
    SEVERE: Context startup failed due to previous errors
    Mar 19, 2004 1:44:54 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path from URL file:H:\jwsdp-1.3\webapps\ROOT
    Mar 19, 2004 1:44:54 PM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Skipped installing application listeners due to previous error(s)
    Mar 19, 2004 1:44:54 PM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    Mar 19, 2004 1:44:54 PM org.apache.catalina.core.StandardContext start
    SEVERE: Context startup failed due to previous errors
    Mar 19, 2004 1:44:54 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /jsp-examples from URL file:H:\jwsdp-1.3\webapps\jsp-examples
    Mar 19, 2004 1:44:55 PM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Skipped installing application listeners due to previous error(s)
    Mar 19, 2004 1:44:55 PM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    Mar 19, 2004 1:44:55 PM org.apache.catalina.core.StandardContext start
    SEVERE: Context startup failed due to previous errors
    Mar 19, 2004 1:44:55 PM org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /servlets-examples from URL file:H:\jwsdp-1.3\webapps\servlets-examples
    Mar 19, 2004 1:44:56 PM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Skipped installing application listeners due to previous error(s)
    Mar 19, 2004 1:44:56 PM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    Mar 19, 2004 1:44:56 PM org.apache.catalina.core.StandardContext start
    SEVERE: Context startup failed due to previous errors
    Mar 19, 2004 1:44:56 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on port 8080
    Mar 19, 2004 1:44:56 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 63891 ms
    So what's wrong with my installation.
    kind regards, Ingo

    Your server may be in an unstable state if you did not remove all of the old cached files.
    I recommend you clear out your <JWSDP_HOME>/work directory and remove all the <JWSDP_HOME>/conf/Catalina/localhost/jsf* files and restart your server.
    Thanks,
    Justyna

  • Firefox is trying to update my 8.0 version to 9.0.1. I'm not ready to do so because the Norton Toolbar is not yet compatable with the new Firefox release. How do I get firefox to stop trying to update every time I open the application?

    Question
    Firefox is trying to update my 8.0 version to 9.0.1. I'm not ready to do so because the Norton Toolbar is not yet compatable with the new Firefox release. How do I get firefox to stop trying to update every time I open the application?

    Swarnava wrote: '''''Firefox 9 is Compatible with Norton 2011, 2012, 360 v5'''''.
    This reads backwards, It is the other way as "Norton update is compatible with Firefox 9".

  • When is the new iPhone release date?

    When is the new iPhone release date? And which is it ?

    Apple has not announced any new iPhone, & speculation about future Apple products is prohibited on this forum.

  • I downloaded Mountain Lion OSX and I can't get onto YouTube, nor do I have facebook notifications on the new feature... Help?

    I downloaded Mountain Lion OSX and I can't get onto YouTube, nor do I have facebook notifications on the new feature... Help?

    Not sure about YouTube, but facebook integration isn't available until this fall.

  • Hello, tell me please why do not work Push notification in the official Iphone 3gs, firmware 5,1,1. Before that was flashing 5,0,1 first about 3 months of work, recently ceased. Tell me what to do? Phone official!

    Hello, tell me please why do not work Push notification in the official Iphone 3gs, firmware 5,1,1. Before that was flashing 5,0,1 first about 3 months of work, recently ceased. Tell me what to do? Phone official!

    it seems there is some kind of problem with this 3gs phone. i have been trying to resolve this problem for 4 days now

  • Hello The problem appeared two days ago is that I can't open my mail app. everything was fine and functional. Now I double click on the icon and it does not respond. it receives mail and I can see push notifications on the mail icon but when  I try t

    hello
    The problem appeared two days ago is that I can't open my mail app. everything was fine and functional. Now I double click on the icon and it does not respond. it receives mail and I can see push notifications on the mail icon but when  I try to open it is no use. OS Y 10.10.2 (14C1514)

    Please follow these directions to delete the Mail "sandbox" folder.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Containers/com.apple.mail
    Right-click or control-click the highlighted line and select
              Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder named "com.apple.mail" selected. If it does, move the selected folder—not just its contents—to the Desktop. Leave the Finder window open for now.
    Restart the computer. Launch Mail and test. If the problem is resolved, you may have to recreate some of your Mail settings. Any custom stationery that you created may be lost. Ask for instructions if you want to preserve that data. You can then delete the folder you moved and close the Finder window.
    Caution: If you change any of the contents of the sandbox, but leave the folder itself in place, Mail may crash or not launch at all. Deleting the whole sandbox will cause it to be rebuilt automatically.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Are any Houston Chronicle for iPad readers not reliably receiving their daily push notification from the app?

    Ever since the update to ios 7, the push notification from the Chronicle has been VERY unreliable.  Is anybody else having a similar experience?

    Hi,
    1. Did you install any protection application on you iphone?
    2. Please try to test push notification to see if any error message is received when Lync 2010 is disappeared from notification setting.
    Test-CsMcxPushNotification -AccessEdgeFqdn <Access Edge service FQDN>
    Regards,
    Kent Huang
    TechNet Community Support ************************************************************************************************************************
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.

  • Help, I did not enable push notifications for the Reminders app

    If I was asked if I wanted push notifications for the Reminders app and I declined, how do I go back and enable that feature? Thank you in advance for the help.

    No problem. See the restoring topic of:
    iTunes: Backing up, updating, and restoring your iPhone, iPad, or iPod touch software

  • Will the calendar app be updated with the new version release in september?

    Will the calendar application be updated with the new versiion release in september to allow the user to further refine repeating events?

    This page shows you what has currently been released about what is in iOS 5 : http://www.apple.com/ios/ios5/features.html

Maybe you are looking for