Skip to content

Commit

Permalink
Merge pull request #116 from square/bcheng/revert-oncreate-changes
Browse files Browse the repository at this point in the history
Revert onCreate changes
  • Loading branch information
Armaxis authored Aug 28, 2024
2 parents 93d8fc1 + f161196 commit 2840d63
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ private void initializeReaderSdk() {
return;
}

ReaderSdk.initialize(currentActivity.getApplication());
sdkInitialized = true;
try {
ReaderSdk.initialize(currentActivity.getApplication());
sdkInitialized = true;
} catch (IllegalStateException e) {
// allow double-initialization; devs _should_ init in Application.onCreate,
// but to be non-breaking we try here also in case they didn't.
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
*/
package com.example.flutter.squareup.sdk.reader;

import io.flutter.embedding.android.FlutterActivity
import androidx.annotation.NonNull;

class MainActivity: FlutterActivity() {
import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@
*/
package com.example.flutter.squareup.sdk.reader;

import io.flutter.app.FlutterApplication
import com.squareup.sdk.reader.ReaderSdk;
import io.flutter.app.FlutterApplication;

class MainApplication: FlutterApplication() {
import io.flutter.view.FlutterMain;


public class MainApplication extends FlutterApplication {

@Override
public void onCreate() {
super.onCreate();
ReaderSdk.initialize(this);
FlutterMain.startInitialization(this);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: square_reader_sdk
description: An open source Flutter plugin for calling Square’s native Reader SDK implementations to take in-person payments on iOS and Android.
version: 4.0.0
version: 4.0.1
homepage: https://github.com/square/reader-sdk-flutter-plugin

environment:
Expand Down

0 comments on commit 2840d63

Please sign in to comment.