Skip to content

Commit

Permalink
Remove init on main thread as it is no longer needed in this version …
Browse files Browse the repository at this point in the history
…of the SDK (#1427)

* Remove init on main thread as it is no longer needed in this version of the SDK

* fix lint

Co-authored-by: andres.aguilar <andres.aguilar@nfl.com>
  • Loading branch information
andresesfm and andres.aguilar authored Jul 16, 2021
1 parent ee1d26a commit 29f8d6c
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.WritableNativeArray;
import java.util.HashSet;
import java.util.Set;
Expand All @@ -33,11 +32,8 @@ public String getName() {

@ReactMethod
public void initConnection(final Promise promise) {
UiThreadUtil.runOnUiThread(
() ->
PurchasingService.registerListener(
getReactApplicationContext(),
new RNIapAmazonListener(getReactApplicationContext())));
ReactApplicationContext context = getReactApplicationContext();
PurchasingService.registerListener(context, new RNIapAmazonListener(context));
// Prefetch user and purchases as per Amazon SDK documentation:
PurchasingService.getUserData();
PurchasingService.getPurchaseUpdates(false);
Expand Down

0 comments on commit 29f8d6c

Please sign in to comment.