如何将本地服务器上运行的appengine应用程序与GCM服务器连接起来 [英] How to connect appengine application running on local server with GCM server

查看:121
本文介绍了如何将本地服务器上运行的appengine应用程序与GCM服务器连接起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了客户端 - 服务器项目来找出GCM(Google Cloud Messaging)服务。我在第一次尝试时运行良好,当我部署时: -

1)Android App到我的设备。



< 2)Appengine应用程序Appengine服务器。



但是我错过了一件事情,如果我需要更改项目主要在appengine应用程序。每次我需要部署到appengine服务器来测试它是否正常工作。它需要大量的时间。



如何使用android DEVICE(作为客户端)测试LOCAL appengine服务器应用程序(作为服务器)不是模拟器....? 我的意思是如何在本地服务器上运行的aappengine应用程序连接到GCM服务器(在WWW上的某个地方),从而在我的Android设备上产生推送通知...

解决方案

要发送消息到GCM服务器,您甚至不需要运行本地服务器。在本地计算机上运行的任何可以连接到互联网并发送HTTP POST请求的应用程序都可以向GCM服务器发送一条消息,该消息将发送到您的设备(假设您使用正确的注册ID)。



如果您希望Android应用程序将注册ID发送到本地计算机,则只需要本地服务器。



这意味着您可以在本地轻松测试大部分服务器代码,而无需设置本地服务器。


I have created client-server project to figure out GCM(Google Cloud Messaging) service. It is working well on my first try when i deployed :--

1)Android App to my device.

2)Appengine App to Appengine server.

But i am missing one thing what if i need to make changes to project mainly on appengine app. Every time i need to deploy to appengine server to test it whether its working properly or not. Its takes lots of time.

How to test LOCAL appengine server app (as server) with android DEVICE (as client) not emulator....?? I mean how aappengine application running on local server connects to GCM server (somewhere on WWW) resulting push notification on my android device...

解决方案

To send messages to the GCM server you don't even need to run a local server. Any application running on your local computer that can connect to the internet and send an HTTP POST request can send a message to the GCM server, which will be sent to your device (assuming you use the correct registration ID).

You only need a local server if you want your Android app to send the registration ID to your local computer.

This means you can easily test most of your server code locally without setting up a local server.

这篇关于如何将本地服务器上运行的appengine应用程序与GCM服务器连接起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆