提交 d1a80a04 authored 作者: 史晓晨's avatar 史晓晨

init

上级
{
"configVersion": 2,
"packages": [
{
"name": "async",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/async-2.11.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "boolean_selector",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.1",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "characters",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/characters-1.3.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "clock",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "collection",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/collection-1.18.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "fake_async",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.3.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter",
"rootUri": "file:///Users/shixiaochen/work/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "flutter_lints",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/flutter_lints-2.0.3",
"packageUri": "lib/",
"languageVersion": "2.19"
},
{
"name": "flutter_test",
"rootUri": "file:///Users/shixiaochen/work/flutter/packages/flutter_test",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "leak_tracker",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker-10.0.0",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "leak_tracker_flutter_testing",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker_flutter_testing-2.0.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "leak_tracker_testing",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker_testing-2.0.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "lints",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/lints-2.1.1",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "matcher",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.16+1",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "material_color_utilities",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.8.0",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "meta",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/meta-1.11.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "path",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/path-1.9.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "plugin_platform_interface",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/plugin_platform_interface-2.1.8",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "sky_engine",
"rootUri": "file:///Users/shixiaochen/work/flutter/bin/cache/pkg/sky_engine",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "source_span",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.10.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "stack_trace",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.11.1",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "stream_channel",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.2",
"packageUri": "lib/",
"languageVersion": "2.19"
},
{
"name": "string_scanner",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.2.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "term_glyph",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "test_api",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.6.1",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "vector_math",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.4",
"packageUri": "lib/",
"languageVersion": "2.14"
},
{
"name": "vm_service",
"rootUri": "file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/vm_service-13.0.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "aliyun_push",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "2.18"
}
],
"generated": "2025-09-09T05:26:01.341541Z",
"generator": "pub",
"generatorVersion": "3.3.4"
}
async
2.18
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/async-2.11.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/async-2.11.0/lib/
boolean_selector
2.17
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.1/lib/
characters
2.12
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/characters-1.3.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/characters-1.3.0/lib/
clock
2.12
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.1/lib/
collection
2.18
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/collection-1.18.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/collection-1.18.0/lib/
fake_async
2.12
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.3.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.3.1/lib/
flutter_lints
2.19
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/flutter_lints-2.0.3/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/flutter_lints-2.0.3/lib/
leak_tracker
3.1
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker-10.0.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker-10.0.0/lib/
leak_tracker_flutter_testing
3.1
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker_flutter_testing-2.0.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker_flutter_testing-2.0.1/lib/
leak_tracker_testing
3.1
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker_testing-2.0.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/leak_tracker_testing-2.0.1/lib/
lints
3.0
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/lints-2.1.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/lints-2.1.1/lib/
matcher
3.0
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.16+1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.16+1/lib/
material_color_utilities
2.17
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.8.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.8.0/lib/
meta
2.12
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/meta-1.11.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/meta-1.11.0/lib/
path
3.0
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/path-1.9.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/path-1.9.0/lib/
plugin_platform_interface
3.0
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/plugin_platform_interface-2.1.8/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/plugin_platform_interface-2.1.8/lib/
source_span
2.18
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.10.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.10.0/lib/
stack_trace
2.18
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.11.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.11.1/lib/
stream_channel
2.19
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.2/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.2/lib/
string_scanner
2.18
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.2.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.2.0/lib/
term_glyph
2.12
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.1/lib/
test_api
3.0
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.6.1/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.6.1/lib/
vector_math
2.14
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.4/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.4/lib/
vm_service
3.0
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/vm_service-13.0.0/
file:///Users/shixiaochen/.pub-cache/hosted/pub.flutter-io.cn/vm_service-13.0.0/lib/
sky_engine
3.2
file:///Users/shixiaochen/work/flutter/bin/cache/pkg/sky_engine/
file:///Users/shixiaochen/work/flutter/bin/cache/pkg/sky_engine/lib/
flutter
3.2
file:///Users/shixiaochen/work/flutter/packages/flutter/
file:///Users/shixiaochen/work/flutter/packages/flutter/lib/
flutter_test
3.2
file:///Users/shixiaochen/work/flutter/packages/flutter_test/
file:///Users/shixiaochen/work/flutter/packages/flutter_test/lib/
aliyun_push
2.18
file:///Users/shixiaochen/work/project/aliyun_push_clx/
file:///Users/shixiaochen/work/project/aliyun_push_clx/lib/
2
3.19.6
\ No newline at end of file
## 0.0.1
* 集成Android推送 3.8.2版本,iOS推送1.9.9.7版本
## 0.0.2
* 更新LICENSE
## 0.0.3
* 内部代码优化
## 0.0.4
* README优化
* 代码优化
* 增加控制插件日志是否开启的API
## 0.0.5
* 修复Android创建Channel时desc字段key值不一致问题
## 0.0.6
* android代码增加保护机制
## 0.0.7
* ios初始化时增加网络判断
## 0.0.8
* Android升级到3.8.5版本
## 0.0.9
* 优化代码
## 0.1.0
* Android升级到3.8.6版本
## 0.1.1
* 回调参数类型转换错误修复
* Android 小米通道升级至3.8.6.1版本
## 0.1.7
* 修复因缺少namespace导致8.0以上agp构建失败问题
* 修改插件依赖配置,去除构建过程中因apply方式依赖插件输出的警告
* 去除初始化过程中调用turnOnPushChannel()导致控制台输出获取不到deviceId的问题
* 去除example中dropdown_button2依赖,改为通过弹出的方式设置logLevel
## 0.1.8
* 修复iOS可能出现的崩溃问题
* 修复iOS demo运行失败问题
## 1.0.0-beta.1
* 升级iOS端SDK版本
* 更新部分api
## 1.0.0
* 修复onNotification回调,Android端通知缺少title和summary字段的问题
\ No newline at end of file
MIT License
Copyright (c) 2023 Alibaba Cloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
差异被折叠。
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
group 'com.aliyun.ams.push'
version '1.0'
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.0'
}
}
rootProject.allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://maven.aliyun.com/nexus/content/repositories/releases/'
}
// 配置HMS Core SDK的Maven仓地址。
maven {
url 'https://developer.huawei.com/repo/'
}
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 36
namespace "com.aliyun.ams.push"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 19
}
}
dependencies {
api 'com.aliyun.ams:alicloud-android-push:3.8.7'
api "com.aliyun.ams:alicloud-android-third-push:3.8.7"
api "com.aliyun.ams:alicloud-android-third-push-meizu:3.8.7"
api "com.aliyun.ams:alicloud-android-third-push-vivo:3.8.7"
api "com.aliyun.ams:alicloud-android-third-push-oppo:3.8.7"
api "com.aliyun.ams:alicloud-android-third-push-xiaomi:3.8.7"
api "com.aliyun.ams:alicloud-android-third-push-huawei:3.8.7"
api "com.aliyun.ams:alicloud-android-third-push-honor:3.8.7"
api 'com.aliyun.ams:alicloud-android-third-push-fcm:3.8.7'
}
rootProject.name = 'push'
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.aliyun.ams.push">
</manifest>
package com.aliyun.ams.push;
import android.util.Log;
/**
* @author wangyun
* @date 2023/1/18
*/
public class AliyunPushLog {
private static boolean sLogEnabled = false;
public static boolean isLogEnabled() {
return sLogEnabled;
}
public static void setLogEnabled(boolean logEnabled) {
sLogEnabled = logEnabled;
}
public static void d(String tag, String msg) {
if (sLogEnabled) {
Log.d(tag, msg);
}
}
public static void e(String tag, String msg) {
if (sLogEnabled) {
Log.e(tag, msg);
}
}
}
package com.aliyun.ams.push;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.sdk.android.push.MessageReceiver;
import com.alibaba.sdk.android.push.notification.CPushMessage;
import com.alibaba.sdk.android.push.notification.NotificationConfigure;
import com.alibaba.sdk.android.push.notification.PushData;
import android.app.Notification;
import android.content.Context;
import android.util.Log;
import androidx.core.app.NotificationCompat;
/**
* @author wangyun
* @date 2023/1/12
*/
public class AliyunPushMessageReceiver extends MessageReceiver {
// 消息接收部分的LOG_TAG
public static final String REC_TAG = "MPS:receiver";
@Override
public NotificationConfigure hookNotificationBuild() {
return new NotificationConfigure() {
@Override
public void configBuilder(Notification.Builder builder, PushData pushData) {
AliyunPushLog.e(REC_TAG, "configBuilder");
}
@Override
public void configBuilder(NotificationCompat.Builder builder, PushData pushData) {
AliyunPushLog.e(REC_TAG, "configBuilder");
}
@Override
public void configNotification(Notification notification, PushData pushData) {
AliyunPushLog.e(REC_TAG, "configNotification");
}
};
}
@Override
public boolean showNotificationNow(Context context, Map<String, String> map) {
for (Map.Entry<String, String> entry : map.entrySet()) {
AliyunPushLog.e(REC_TAG, "key " + entry.getKey() + " value " + entry.getValue());
}
return super.showNotificationNow(context, map);
}
/**
* 推送通知的回调方法
*
* @param context
* @param title
* @param summary
* @param extraMap
*/
@Override
public void onNotification(Context context, String title, String summary,
Map<String, String> extraMap) {
Map<String, Object> arguments = new HashMap<>();
if (null != extraMap) {
arguments.putAll(extraMap);
} else {
}
arguments.put("title", title);
arguments.put("summary", summary);
AliyunPushPlugin.sInstance.callFlutterMethod("onNotification", arguments);
}
/**
* 应用处于前台时通知到达回调。注意:该方法仅对自定义样式通知有效,相关详情请参考https://help.aliyun.com/document_detail/30066
* .html?spm=5176.product30047.6.620.wjcC87#h3-3-4-basiccustompushnotification-api
*
* @param context
* @param title
* @param summary
* @param extraMap
* @param openType
* @param openActivity
* @param openUrl
*/
@Override
protected void onNotificationReceivedInApp(Context context, String title, String summary,
Map<String, String> extraMap, int openType,
String openActivity, String openUrl) {
Map<String, Object> arguments = new HashMap<>();
if (extraMap != null && !extraMap.isEmpty()) {
arguments.putAll(extraMap);
}
arguments.put("title", title);
arguments.put("summary", summary);
arguments.put("openType", openType);
arguments.put("openActivity", openActivity);
arguments.put("openUrl", openUrl);
AliyunPushPlugin.sInstance.callFlutterMethod("onNotificationReceivedInApp", arguments);
}
/**
* 推送消息的回调方法
*
* @param context
* @param cPushMessage
*/
@Override
public void onMessage(Context context, CPushMessage cPushMessage) {
Map<String, Object> arguments = new HashMap<>();
arguments.put("title", cPushMessage.getTitle());
arguments.put("content", cPushMessage.getContent());
arguments.put("msgId", cPushMessage.getMessageId());
arguments.put("appId", cPushMessage.getAppId());
arguments.put("traceInfo", cPushMessage.getTraceInfo());
AliyunPushPlugin.sInstance.callFlutterMethod("onMessage", arguments);
}
/**
* 从通知栏打开通知的扩展处理
*
* @param context
* @param title
* @param summary
* @param extraMap
*/
@Override
public void onNotificationOpened(Context context, String title, String summary,
String extraMap) {
Map<String, Object> arguments = new HashMap<>();
arguments.put("title", title);
arguments.put("summary", summary);
arguments.put("extraMap", extraMap);
AliyunPushPlugin.sInstance.callFlutterMethod("onNotificationOpened", arguments);
}
/**
* 通知删除回调
*
* @param context
* @param messageId
*/
@Override
public void onNotificationRemoved(Context context, String messageId) {
Map<String, Object> arguments = new HashMap<>();
arguments.put("msgId", messageId);
AliyunPushPlugin.sInstance.callFlutterMethod("onNotificationRemoved", arguments);
}
/**
* 无动作通知点击回调。当在后台或阿里云控制台指定的通知动作为无逻辑跳转时,
* 通知点击回调为onNotificationClickedWithNoAction而不是onNotificationOpened
*
* @param context
* @param title
* @param summary
* @param extraMap
*/
@Override
protected void onNotificationClickedWithNoAction(Context context, String title, String summary
, String extraMap) {
Map<String, Object> arguments = new HashMap<>();
arguments.put("title", title);
arguments.put("summary", summary);
arguments.put("extraMap", extraMap);
AliyunPushPlugin.sInstance.callFlutterMethod("onNotificationClickedWithNoAction", arguments);
}
}
\ No newline at end of file
package com.aliyun.ams.push;
import com.alibaba.sdk.android.push.HonorRegister;
import com.alibaba.sdk.android.push.huawei.HuaWeiRegister;
import com.alibaba.sdk.android.push.register.GcmRegister;
import com.alibaba.sdk.android.push.register.MeizuRegister;
import com.alibaba.sdk.android.push.register.MiPushRegister;
import com.alibaba.sdk.android.push.register.OppoRegister;
import com.alibaba.sdk.android.push.register.VivoRegister;
import android.app.Application;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
/**
* @author wangyun
* @date 2023/1/13
*/
public class AliyunThirdPushUtils {
private static String getAppMetaDataWithId(Context context, String key) {
String value = getAppMetaData(context, key);
if (value != null && value.startsWith("id=")) {
return value.replace("id=", "");
}
return value;
}
public static String getAppMetaData(Context context, String key) {
try {
final PackageManager packageManager = context.getPackageManager();
final String packageName = context.getPackageName();
ApplicationInfo info = packageManager.getApplicationInfo(packageName,
PackageManager.GET_META_DATA);
if (info != null && info.metaData != null && info.metaData.containsKey(key)) {
return String.valueOf(info.metaData.get(key));
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return null;
}
public static void registerGCM(Application application) {
String sendId = getGCMSendId(application);
String applicationId = getGCMApplicationId(application);
String projectId = getGCMProjectId(application);
String apiKey = getGCMApiKey(application);
if (sendId != null && applicationId != null && projectId != null && apiKey != null) {
GcmRegister.register(application, sendId, applicationId, projectId, apiKey);
}
}
private static String getGCMSendId(Context context) {
return getAppMetaDataWithId(context, "com.gcm.push.sendid");
}
private static String getGCMApplicationId(Context context) {
return getAppMetaDataWithId(context, "com.gcm.push.applicationid");
}
private static String getGCMProjectId(Context context) {
return getAppMetaDataWithId(context, "com.gcm.push.projectid");
}
private static String getGCMApiKey(Context context) {
return getAppMetaDataWithId(context, "com.gcm.push.api.key");
}
public static void registerMeizuPush(Application application) {
String meizuId = getMeizuPushId(application);
String meizuKey = getMeizuPushKey(application);
if (meizuId != null && meizuKey != null) {
MeizuRegister.register(application, meizuId, meizuKey);
}
}
private static String getMeizuPushId(Context context) {
return getAppMetaDataWithId(context, "com.meizu.push.id");
}
private static String getMeizuPushKey(Context context) {
return getAppMetaDataWithId(context, "com.meizu.push.key");
}
public static void registerOppoPush(Application application) {
String oppoKey = getOppoPushKey(application);
String oppoSecret = getOppoPushSecret(application);
if (oppoKey != null && oppoSecret != null) {
OppoRegister.register(application, oppoKey, oppoSecret);
}
}
private static String getOppoPushKey(Context context) {
return getAppMetaDataWithId(context, "com.oppo.push.key");
}
private static String getOppoPushSecret(Context context) {
return getAppMetaDataWithId(context, "com.oppo.push.secret");
}
public static void registerXiaoMiPush(Application application) {
String xiaoMiId = getXiaoMiId(application);
String xiaoMiKey = getXiaoMiKey(application);
if (xiaoMiId != null && xiaoMiKey != null) {
MiPushRegister.register(application, xiaoMiId, xiaoMiKey);
}
}
private static String getXiaoMiId(Context context) {
return getAppMetaDataWithId(context, "com.xiaomi.push.id");
}
private static String getXiaoMiKey(Context context) {
return getAppMetaDataWithId(context, "com.xiaomi.push.key");
}
public static void registerVivoPush(Application application) {
String vivoApiKey = getVivoApiKey(application);
String vivoAppId = getVivoAppId(application);
if (vivoApiKey != null && vivoAppId != null) {
VivoRegister.register(application);
}
}
private static String getVivoApiKey(Context context) {
return getAppMetaData(context, "com.vivo.push.api_key");
}
private static String getVivoAppId(Context context) {
return getAppMetaData(context, "com.vivo.push.app_id");
}
public static void registerHuaweiPush(Application application) {
String huaweiAppId = getHuaWeiAppId(application);
if (huaweiAppId != null) {
HuaWeiRegister.register(application);
}
}
private static String getHuaWeiAppId(Context context) {
String value = getAppMetaData(context, "com.huawei.hms.client.appid");
if (value != null && value.startsWith("appid=")) {
return value.replace("appid=", "");
}
return null;
}
public static void registerHonorPush(Application application) {
String honorAppId = getHonorAppId(application);
if (honorAppId != null) {
HonorRegister.register(application);
}
}
private static String getHonorAppId(Context context) {
return getAppMetaData(context, "com.hihonor.push.app_id");
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{"inputs":["/Users/shixiaochen/work/flutter/packages/flutter_tools/lib/src/build_system/targets/ios.dart","/Users/shixiaochen/work/project/aliyun_push_clx/example/.dart_tool/flutter_build/ffcd8e42a86383583ec4eae063f0ceb1/app.dill","/Users/shixiaochen/work/flutter/bin/internal/engine.version","/Users/shixiaochen/work/flutter/bin/internal/engine.version"],"outputs":["/Users/shixiaochen/work/project/aliyun_push_clx/example/build/ios/Release-iphoneos/App.framework/App"]}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.App.framework</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论