handle remote notification payloads ()

* handle remote notification payloads
* handle intent extras for background notifications
This commit is contained in:
Akinwale Ariwodola 2019-10-30 10:34:57 +01:00 committed by GitHub
parent 6e6ed07890
commit 42cf11358e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 96 additions and 12 deletions
src/main/java/io/lbry/browser/reactmodules

View file

@ -52,6 +52,15 @@ public class UtilityModule extends ReactContextBaseJavaModule {
public static final String ACTION_NOTIFICATION_LATER = "io.lbry.browser.ACTION_NOTIFICATION_LATER";
public static final String RECEIVE_SUBSCRIPTION_NOTIFICATIONS = "receiveSubscriptionNotifications";
public static final String RECEIVE_REWARD_NOTIFICATIONS = "receiveRewardNotifications";
public static final String RECEIVE_INTERESTS_NOTIFICATIONS = "receiveInterestsNotifications";
public static final String RECEIVE_CREATOR_NOTIFICATIONS = "receiveCreatorNotifications";
private Context context;
private KeyStore keyStore;
@ -377,4 +386,14 @@ public class UtilityModule extends ReactContextBaseJavaModule {
Intent.createChooser(intent, "Select a file"), MainActivity.DOCUMENT_PICKER_RESULT_CODE);
}
}
@ReactMethod
public void setNativeBooleanSetting(String key, boolean value) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean(key, value);
editor.commit();
}
}
}