[skip ci] push notification changes

This commit is contained in:
Matthew Fosse 2024-04-18 13:13:06 -07:00
parent 74fb6e6b2c
commit 0aae072ae9
2 changed files with 28 additions and 0 deletions

View file

@ -9,6 +9,8 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application
android:name=".Application"
@ -84,6 +86,23 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<!-- service to handle messaging events -->
<service
android:name=".NotificationFcmService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- service to handle the foreground service -->
<service
android:name=".NotificationForegroundService"
android:foregroundServiceType="shortService"
android:exported="false"
android:stopWithTask="false">
</service>
</application>
<queries>

View file

@ -211,6 +211,15 @@ abstract class LightningWalletBase extends ElectrumWallet with Store {
_isTransactionUpdating = false;
});
// TODO: get actual nds service url:
if (Platform.isAndroid || Platform.isIOS) {
String platform = Platform.isAndroid ? "android" : "ios";
String token = "TODO";
await sdk.registerWebhook(
webhookUrl: "https://your-nds-service.com/notify?platform=$platform&token=$token",
);
}
print("initialized breez: ${(await sdk.isInitialized())}");
}