小编M_G*_*M_G的帖子

Google云消息传递:100个多个发件人限制

我的Android应用程序需要启用来自多个发件人的GCM推送通知.我已经读过这里有可能:接收来自多个发件人的邮件.但是,提到有100个多发送者的限制.在我的用例中,我可能有超过100个发件人(具有不同发件人ID和api密钥的服务器),但安装在设备上的每个应用程序将注册到少量发件人(少于100).

这就是我需要它的工作方式:
1.当用户登录时,客户端应用程序将直接向应用服务器发送休息,以获取与该用户相关的发送者ID.可能的发件人ID数大于100,但对于特定用户,与该用户相关的发件人ID子集可能为1.
2.客户端应用程序将为返回的发件人集中的每个senderId执行以下代码IDS:

String token = instanceID.getToken(senderId),
            GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
Run Code Online (Sandbox Code Playgroud)

我想确保100个多个发件人的限制不适用于我的用例.我试着更多地了解这个限制,但是空洞了.

提前致谢!

android push-notification google-cloud-messaging

10
推荐指数
1
解决办法
282
查看次数

Android:键盘打开时Webview滚动不足

在我的应用程序中,我有一个Web视图,该视图加载了用户应在其中执行身份验证的网页。当用户在网页中选择某个输入字段时,Webview应:

  1. 专注于领域
  2. 打开键盘
  3. 执行向上滚动以便用户继续查看该字段

但是,Web视图不会自动向上滚动,因此用户不再看到该字段。如果用户尝试手动滚动,则Webview只会进行少量滚动-不足以使用户看到他需要的所有内容。问题不在于网页本身,因为当我使用android chrome浏览到该网页时,它确实向上滚动以保持字段可见,并允许滚动到页面底部。我已经阅读了以下问题: 键盘打开时WebView不滚动adjustPan不能阻止键盘覆盖EditText, 但是答案不能解决问题。

我当前的activity_web_viewlogin.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/portalWebViewWrapper"
    android:orientation="vertical"
    tools:context="com.hpe.sb.mobile.app.features.login.activities.WebViewLoginActivity">
    <include
        android:id="@+id/app_bar"
        layout="@layout/app_bar" />

   <ScrollView android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:fillViewport="true">

        <WebView
            android:id="@+id/portalWebView"
            android:layout_below="@id/app_bar"
            android:layout_width="match_parent"
            android:layout_margin="@dimen/activity_vertical_margin"
            android:layout_height="match_parent"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />

   </ScrollView>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

还尝试了ScrollView包含LinearLayout。

在我的AndroidManifest.xml中:

        <activity
           android:name=".features.login.activities.WebViewLoginActivity"
           android:windowSoftInputMode="adjustResize"
           android:label="" />
Run Code Online (Sandbox Code Playgroud)

也尝试了AdjustPan而不是AdjustResize。

提前致谢!

android scrollview webview

6
推荐指数
1
解决办法
5051
查看次数

Google云消息传递:registration_ids与设备组

我应该何时更喜欢通过注册ID列表(带有registration_ids参数的消息)向设备组发送消息?

管理设备组似乎只会增加复杂性.对于设备组,应用服务器应包含何时创建组或仅添加注册ID的逻辑.服务器仍然需要在一些数据库中保存注册ID,此外它现在需要保存通知密钥.该回应似乎不太详细:未指定失败的原因,所以它很难知道应该以防止故障进行(?卸载该应用程序是注册令牌过期等等?).
我错过了什么?有什么好处?

提前致谢!

android push-notification google-cloud-messaging

5
推荐指数
1
解决办法
651
查看次数