-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/sorydima/REChain-
- Loading branch information
Showing
4 changed files
with
33 additions
and
31 deletions.
There are no files selected for viewing
58 changes: 29 additions & 29 deletions
58
android/app/src/main/kotlin/com/rechain/online/FcmPushService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
package com.rechain.online | ||
// package com.rechain.online | ||
|
||
import com.famedly.fcm_shared_isolate.FcmSharedIsolateService | ||
// import com.famedly.fcm_shared_isolate.FcmSharedIsolateService | ||
|
||
import com.rechain.online.MainActivity | ||
// import com.rechain.online.MainActivity | ||
|
||
import io.flutter.embedding.android.FlutterActivity | ||
import io.flutter.embedding.engine.FlutterEngine | ||
import io.flutter.view.FlutterMain | ||
import io.flutter.embedding.engine.dart.DartExecutor.DartEntrypoint | ||
// import io.flutter.embedding.android.FlutterActivity | ||
// import io.flutter.embedding.engine.FlutterEngine | ||
// import io.flutter.view.FlutterMain | ||
// import io.flutter.embedding.engine.dart.DartExecutor.DartEntrypoint | ||
|
||
import android.content.Context | ||
import android.os.Bundle | ||
import android.util.Log | ||
import android.view.WindowManager | ||
// import android.content.Context | ||
// import android.os.Bundle | ||
// import android.util.Log | ||
// import android.view.WindowManager | ||
|
||
class FcmPushService : FcmSharedIsolateService() { | ||
override fun getEngine(): FlutterEngine { | ||
return provideEngine(getApplicationContext()) | ||
} | ||
// class FcmPushService : FcmSharedIsolateService() { | ||
// override fun getEngine(): FlutterEngine { | ||
// return provideEngine(getApplicationContext()) | ||
// } | ||
|
||
companion object { | ||
fun provideEngine(context: Context): FlutterEngine { | ||
var engine = MainActivity.engine | ||
if (engine == null) { | ||
engine = MainActivity.provideEngine(context) | ||
engine.getLocalizationPlugin().sendLocalesToFlutter( | ||
context.getResources().getConfiguration()) | ||
engine.getDartExecutor().executeDartEntrypoint( | ||
DartEntrypoint.createDefault()) | ||
} | ||
return engine | ||
} | ||
} | ||
} | ||
// companion object { | ||
// fun provideEngine(context: Context): FlutterEngine { | ||
// var engine = MainActivity.engine | ||
// if (engine == null) { | ||
// engine = MainActivity.provideEngine(context) | ||
// engine.getLocalizationPlugin().sendLocalesToFlutter( | ||
// context.getResources().getConfiguration()) | ||
// engine.getDartExecutor().executeDartEntrypoint( | ||
// DartEntrypoint.createDefault()) | ||
// } | ||
// return engine | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ class UnifiedPushReceiver : UnifiedPushReceiver() { | |
} | ||
return engine | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters