Skip to content

Commit cfc914d

Browse files
committed
Get Activity from RN Context
• Changes how the SDK gets a reference to the current activity during initialization
1 parent a475754 commit cfc914d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/src/main/java/com/geektime/rnonesignalandroid/RNOneSignal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private JSONObject jsonFromErrorMessageString(String errorMessage) throws JSONEx
105105

106106
@ReactMethod
107107
public void init(String appId) {
108-
Activity activity = getCurrentActivity();
108+
Activity activity = mReactApplicationContext.getCurrentActivity();
109109

110110
if (activity == null) {
111111
// in some cases, especially with react-native-navigation, it can take a while for the Activity to be created

0 commit comments

Comments
 (0)