我创建了 android 应用程序来发送推送通知。我在 Java 代码中获取设备注册 ID,从如何将注册 ID 发送到 asp.net webapi。下面是webapi方法。
[System.Web.Http.HttpGet]
public void SendPushNotification(string deviceRegID, string notificationMessage)
{
AndroidGCMPushNotification apnGCM = new AndroidGCMPushNotification();
string strResponse = apnGCM.NotifyTest(deviceTokenID, notificationMessage);
}
我在浏览器中将此 webapi 称为“ http://www.example.com:80/sendPushNotification/deviceRegID/notificationMessage ”(example.com:80 是 ipaddress 和端口),它正在被触发。如何从 Android mainactivity 调用它。