File tree 4 files changed +26
-8
lines changed
android/src/main/java/com/squareup/sdk/reader/flutter
example/android/app/src/main/java/com/example/flutter/squareup/sdk/reader
4 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,12 @@ private void initializeReaderSdk() {
157
157
return ;
158
158
}
159
159
160
- ReaderSdk .initialize (currentActivity .getApplication ());
161
- sdkInitialized = true ;
160
+ try {
161
+ ReaderSdk .initialize (currentActivity .getApplication ());
162
+ sdkInitialized = true ;
163
+ } catch (IllegalStateException e ) {
164
+ // allow double-initialization; devs _should_ init in Application.onCreate,
165
+ // but to be non-breaking we try here also in case they didn't.
166
+ }
162
167
}
163
- }
168
+ }
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .example .flutter .squareup .sdk .reader ;
17
17
18
- import io.flutter.embedding.android.FlutterActivity
18
+ import androidx . annotation . NonNull ;
19
19
20
- class MainActivity : FlutterActivity () {
20
+ import io .flutter .embedding .android .FlutterActivity ;
21
+
22
+ public class MainActivity extends FlutterActivity {
21
23
}
22
24
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .example .flutter .squareup .sdk .reader ;
17
17
18
- import io.flutter.app.FlutterApplication
18
+ import com .squareup .sdk .reader .ReaderSdk ;
19
+ import io .flutter .app .FlutterApplication ;
19
20
20
- class MainApplication : FlutterApplication () {
21
+ import io .flutter .view .FlutterMain ;
22
+
23
+
24
+ public class MainApplication extends FlutterApplication {
25
+
26
+ @ Override
27
+ public void onCreate () {
28
+ super .onCreate ();
29
+ ReaderSdk .initialize (this );
30
+ FlutterMain .startInitialization (this );
31
+ }
21
32
}
Original file line number Diff line number Diff line change 1
1
name : square_reader_sdk
2
2
description : An open source Flutter plugin for calling Square’s native Reader SDK implementations to take in-person payments on iOS and Android.
3
- version : 4.0.0
3
+ version : 4.0.1
4
4
homepage : https://github.com/square/reader-sdk-flutter-plugin
5
5
6
6
environment :
You can’t perform that action at this time.
0 commit comments