小编Rad*_*ndi的帖子

如何让“onMessageReceived”触发 React Native 中的通知(HMS 推送工具包)?

我正在尝试读取通知的有效负载,但该事件不会触发。它适用于数据消息,但似乎没有注意到通知。

安卓清单:

        <service
            android:name="com.huawei.hms.push.react.RNHmsMessageService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <receiver android:name="com.huawei.hms.push.react.RNReceiver"/>
        <meta-data
            android:name="push_kit_auto_init_enabled"
            android:value="true" />
Run Code Online (Sandbox Code Playgroud)

RNHms消息服务

public void onMessageReceived(RemoteMessage message) {
        Log.i(TAG, "onMessageReceived is called");
        if (message == null) {
            Log.e(TAG, "Received message entity is null!");
            return;
        }

        Log.i(TAG, "getCollapseKey: " + message.getCollapseKey()...

        RemoteMessage.Notification notification = message.getNotification();
        if (notification != null) {
            Log.i(TAG, "\n getImageUrl: " + notification.getImageUrl()...
        }

        Boolean judgeWhetherIn10s = false;
        // If the messages are not processed in 10 seconds, the app needs to use …
Run Code Online (Sandbox Code Playgroud)

android react-native huawei-mobile-services huawei-push-notification

3
推荐指数
1
解决办法
1581
查看次数

AWS Lambda 解压缩 gzip 文件,无需将文件保存在本地

我正在尝试从 S3 存储桶 (.gzip) 获取文件并将其解压缩到另一个存储桶。如果不将文件保存在本地(我的 PC)上,我无法找到一种方法。有没有办法在 Lambda 上“保存”文件并直接在 S3 上解压缩?谢谢!

gzip unzip amazon-s3 amazon-web-services aws-lambda

2
推荐指数
1
解决办法
5506
查看次数