在Flutter中,是否有任何方法可以为基于用户的应用程序推送通知。在文档中,我必须使用external_user_id
。但是在Flutter中我找不到这个功能。
await OneSignal.shared.postNotificationWithJson({
"include_external_user_ids": ["123456789"],
"contents": {"en": "test notification"}
});
然后我尝试使用postNotificationWithJson,但它返回此错误
PlatformException (PlatformException(OneSignal, Encountered an error attempting to postNotification {"errors":["Please include a case-sensitive header of Authorization: Basic <YOUR-REST-API-KEY-HERE> or Bearer token=\"<YOUR-REST-API-KEY-HERE>\" with a valid REST API key."],"reference":["https:\/\/documentation.onesignal.com\/docs\/accounts-and-keys#section-keys-ids"]}, {reference: [https://documentation.onesignal.com/docs/accounts-and-keys#section-keys-ids], errors: [Please include a case-sensitive header of Authorization: Basic <YOUR-REST-API-KEY-HERE> or Bearer token="<YOUR-REST-API-KEY-HERE>" with a valid REST API key.]}, null))
1条答案
按热度按时间ivqmmu1c1#
在Flutter
one_signal ^3.5.1
中,我没有找到这个东西。您可以通过此方法将POST与HTML一起使用