Push Notifications in Android Platform

后端 未结 20 994
长发绾君心
长发绾君心 2020-11-22 11:07

I am looking to write an app that receives pushed alerts from a server. I found a couple of methods to do this.

  1. SMS - Intercept the incoming SMS and initiate
相关标签:
20条回答
  • 2020-11-22 11:46

    I'm afraid you've found both possible methods. Google was, at least initially, going to implement a GChat api you could use for a push/pull implementation. Sadly, that library was cut by Android 1.0.

    0 讨论(0)
  • 2020-11-22 11:46

    I would suggest using both SMS and HTTP. If the user is not signed in send their phone an SMS to notify them there's a message waiting.

    That's how this Ericsson Labs service works: https://labs.ericsson.com/apis/mobile-java-push/

    If you implement this yourself the tricky part is deleting the incoming SMS without the user seeing it. Or maybe it's ok if they see it in your case.

    Looks like this works: Deleting SMS Using BroadCastReceiver - Android

    Yes, writing code like this can be dangerous and you can potentially ruin someone's life because your application deleted an SMS it shouldn't have.

    0 讨论(0)
提交回复
热议问题