Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在同一应用程序的不同用户之间发送消息?_Android_Ios_Message - Fatal编程技术网

Android 如何在同一应用程序的不同用户之间发送消息?

Android 如何在同一应用程序的不同用户之间发送消息?,android,ios,message,Android,Ios,Message,我想制作一个只在应用程序中显示的应用程序内消息系统,如tinder,但要使用该应用程序,用户不必使用任何东西登录。我想知道人们是如何做到这一点的,以及这是否可能?这是可能的,但需要你付出额外的努力。很抱歉,很难在帖子中提供完整详细的答案,所以很简单: 1) 要在应用程序实例之间传递消息,您需要服务器。我使用谷歌来完成类似的任务(当你确定的时候它是免费的) 2) 为了避免登录,您可以使用用户在配置设备时输入的Google帐户要在设备上获取帐户,您可以使用以下代码: AccountManag

我想制作一个只在应用程序中显示的应用程序内消息系统,如tinder,但要使用该应用程序,用户不必使用任何东西登录。我想知道人们是如何做到这一点的,以及这是否可能?

这是可能的,但需要你付出额外的努力。很抱歉,很难在帖子中提供完整详细的答案,所以很简单: 1) 要在应用程序实例之间传递消息,您需要服务器。我使用谷歌来完成类似的任务(当你确定的时候它是免费的) 2) 为了避免登录,您可以使用用户在配置设备时输入的Google帐户
要在设备上获取帐户,您可以使用以下代码:

    AccountManager accountManager = AccountManager.get(context/*activity*/);
    Account[] accounts = accountManager.getAccountsByType("com.google");
    for (Account acc : accounts) {
        userEmail = acc.name.trim();
    // do whatever you need with account
    }