Skip to content

Commit de426bb

Browse files
committed
🎨 Minor lifecycle simplification
1 parent 4843b39 commit de426bb

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ public RNPushNotification(ReactApplicationContext reactContext) {
4141
reactContext.addActivityEventListener(this);
4242

4343
Application applicationContext = (Application) reactContext.getApplicationContext();
44-
RNPushNotificationConfig config = new RNPushNotificationConfig(applicationContext);
4544

4645
// The @ReactNative methods use this
47-
mRNPushNotificationHelper = new RNPushNotificationHelper(applicationContext, config);
46+
mRNPushNotificationHelper = new RNPushNotificationHelper(applicationContext);
4847
// This is used to delivery callbacks to JS
4948
mJsDelivery = new RNPushNotificationJsDelivery(reactContext);
5049

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public class RNPushNotificationHelper {
4444
private static final long ONE_HOUR = 60 * ONE_MINUTE;
4545
private static final long ONE_DAY = 24 * ONE_HOUR;
4646

47-
public RNPushNotificationHelper(Application context, RNPushNotificationConfig config) {
47+
public RNPushNotificationHelper(Application context) {
4848
this.context = context;
49-
this.config = config;
49+
this.config = new RNPushNotificationConfig(context);
5050
this.scheduledNotificationsPersistence = context.getSharedPreferences(RNPushNotificationHelper.PREFERENCES_KEY, Context.MODE_PRIVATE);
5151
}
5252

0 commit comments

Comments
 (0)