-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vivo 应用商店上传版本
- Loading branch information
Showing
33 changed files
with
759 additions
and
106 deletions.
There are no files selected for viewing
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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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
20 changes: 20 additions & 0 deletions
20
flutter_leave_lc/android/app/src/main/java/com/example/flutterapplc/MainActivity.java
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.example.flutterapplc; | ||
|
||
import android.os.Bundle; | ||
import android.os.PersistableBundle; | ||
import android.util.Log; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import com.vivo.push.PushClient; | ||
|
||
import io.flutter.embedding.android.FlutterActivity; | ||
|
||
public class MainActivity extends FlutterActivity { | ||
@Override | ||
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) { | ||
super.onCreate(savedInstanceState, persistentState); | ||
String regId = PushClient.getInstance(MainActivity.this).getRegId(); | ||
Log.d("regid"," regId= " + regId); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
flutter_leave_lc/android/app/src/main/java/com/example/flutterapplc/MyApp.java
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.example.flutterapplc; | ||
|
||
import cn.leancloud.LCException; | ||
import cn.leancloud.LCInstallation; | ||
import cn.leancloud.LCLogger; | ||
import cn.leancloud.LCObject; | ||
import cn.leancloud.LeanCloud; | ||
import cn.leancloud.callback.LCCallback; | ||
import cn.leancloud.vivo.LCMixPushManager; | ||
import io.flutter.app.FlutterApplication; | ||
import io.reactivex.Observer; | ||
import io.reactivex.disposables.Disposable; | ||
|
||
public class MyApp extends FlutterApplication { | ||
private static final String LC_APP_ID = "eLAwFuK8k3eIYxh29VlbHu2N-gzGzoHsz"; | ||
private static final String LC_APP_KEY = "G59fl4C1uLIQVR4BIiMjxnM3"; | ||
private static final String LC_SERVER_URL = "https://elawfuk8.lc-cn-n1-shared.com"; | ||
// private static final String LC_APP_ID = "Gvv2k8PugDTmYOCfuK8tiWd8-gzGzoHsz"; | ||
// private static final String LC_APP_KEY = "dpwAo94n81jPsHVxaWwdxJVu"; | ||
// private static final String LC_SERVER_URL = "https://gvv2k8pu.lc-cn-n1-shared.com"; | ||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
LeanCloud.setLogLevel(LCLogger.Level.DEBUG); | ||
LeanCloud.initialize(this, LC_APP_ID, LC_APP_KEY, LC_SERVER_URL); | ||
System.out.println("打印 initialize = :" + "initialize" ); | ||
LCMixPushManager.registerVIVOPush(this); | ||
LCMixPushManager.turnOnVIVOPush(new LCCallback<Boolean>() { | ||
@Override | ||
protected void internalDone0(Boolean aBoolean, LCException e) { | ||
if (null != e) { | ||
System.out.println("failed to turn on VIVO push. cause:"); | ||
e.printStackTrace(); | ||
} else { | ||
System.out.println("succeed to turn on VIVO push."); | ||
} | ||
} | ||
}); | ||
LCInstallation.getCurrentInstallation().saveInBackground().subscribe(new Observer<LCObject>() { | ||
@Override | ||
public void onSubscribe(Disposable d) { | ||
} | ||
@Override | ||
public void onNext(LCObject avObject) { | ||
// 关联 installationId 到用户表等操作。 | ||
String installationId = LCInstallation.getCurrentInstallation().getInstallationId(); | ||
System.out.println("保存成功:" + installationId ); | ||
} | ||
@Override | ||
public void onError(Throwable e) { | ||
System.out.println("保存失败,错误信息:" + e.getMessage()); | ||
} | ||
@Override | ||
public void onComplete() { | ||
} | ||
}); | ||
String installationId = LCInstallation.getCurrentInstallation().getInstallationId(); | ||
System.out.println("打印 installationId = :" + installationId ); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...er_leave_lc/android/app/src/main/java/com/example/flutterapplc/MyPushMessageReceiver.java
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.example.flutterapplc; | ||
|
||
import android.content.Context; | ||
import android.util.Log; | ||
import android.widget.Toast; | ||
|
||
import com.vivo.push.model.UnvarnishedMessage; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import cn.leancloud.LCVIVOPushMessageReceiver; | ||
|
||
public class MyPushMessageReceiver extends LCVIVOPushMessageReceiver { | ||
private static final Logger logger = Logger.getLogger(MyPushMessageReceiver.class.getSimpleName()); | ||
|
||
@Override | ||
public void onTransmissionMessage(Context context, UnvarnishedMessage unvarnishedMessage) { | ||
super.onTransmissionMessage(context, unvarnishedMessage); | ||
Toast.makeText(context, " 收到透传通知: " + unvarnishedMessage.getMessage(), | ||
Toast.LENGTH_LONG).show(); | ||
Log.d("PushMessageReceiver", " onTransmissionMessage= " | ||
+ unvarnishedMessage.getMessage()); | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
flutter_leave_lc/android/app/src/main/kotlin/com/example/flutterapplc/MainActivity.kt
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
flutter_leave_lc/android/app/src/main/res/drawable-v21/launch_background.xml
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Modify this file to customize your launch splash screen --> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="?android:colorBackground" /> | ||
|
||
<!-- You can insert your own image assets here --> | ||
<!-- <item> | ||
<bitmap | ||
android:gravity="center" | ||
android:src="@mipmap/launch_image" /> | ||
</item> --> | ||
</layer-list> |
Binary file modified
BIN
+0 Bytes
(100%)
flutter_leave_lc/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-30 Bytes
(98%)
flutter_leave_lc/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-64 Bytes
(96%)
flutter_leave_lc/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+31 Bytes
(100%)
flutter_leave_lc/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+127 Bytes
(110%)
flutter_leave_lc/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
flutter_leave_lc/android/app/src/main/res/values-night/styles.xml
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on --> | ||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
<!-- Show a splash screen on the activity. Automatically removed when | ||
Flutter draws its first frame --> | ||
<item name="android:windowBackground">@drawable/launch_background</item> | ||
</style> | ||
<!-- Theme applied to the Android Window as soon as the process has started. | ||
This theme determines the color of the Android Window while your | ||
Flutter UI initializes, as well as behind your Flutter UI while its | ||
running. | ||
This Theme is only used starting with V2 of Flutter's Android embedding. --> | ||
<style name="NormalTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar"> | ||
<item name="android:windowBackground">?android:colorBackground</item> | ||
</style> | ||
</resources> |
12 changes: 11 additions & 1 deletion
12
flutter_leave_lc/android/app/src/main/res/values/styles.xml
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,8 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off --> | ||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar"> | ||
<!-- Show a splash screen on the activity. Automatically removed when | ||
Flutter draws its first frame --> | ||
<item name="android:windowBackground">@drawable/launch_background</item> | ||
</style> | ||
<!-- Theme applied to the Android Window as soon as the process has started. | ||
This theme determines the color of the Android Window while your | ||
Flutter UI initializes, as well as behind your Flutter UI while its | ||
running. | ||
This Theme is only used starting with V2 of Flutter's Android embedding. --> | ||
<style name="NormalTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> | ||
<item name="android:windowBackground">?android:colorBackground</item> | ||
</style> | ||
</resources> |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.enableR8=true | ||
android.useAndroidX=true | ||
android.enableJetifier=true |
Oops, something went wrong.