push
这个提交包含在:
父节点
9d1ee4f909
当前提交
acd57b3724
17
.idea/deploymentTargetDropDown.xml
自动生成的
17
.idea/deploymentTargetDropDown.xml
自动生成的
@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="deploymentTargetDropDown">
|
|
||||||
<runningDeviceTargetSelectedWithDropDown>
|
|
||||||
<Target>
|
|
||||||
<type value="RUNNING_DEVICE_TARGET" />
|
|
||||||
<deviceKey>
|
|
||||||
<Key>
|
|
||||||
<type value="SERIAL_NUMBER" />
|
|
||||||
<value value="192.168.115.170:43303" />
|
|
||||||
</Key>
|
|
||||||
</deviceKey>
|
|
||||||
</Target>
|
|
||||||
</runningDeviceTargetSelectedWithDropDown>
|
|
||||||
<timeTargetWasSelectedWithDropDown value="2023-06-06T09:25:14.359761300Z" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
1
.idea/gradle.xml
自动生成的
1
.idea/gradle.xml
自动生成的
@ -11,6 +11,7 @@
|
|||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
<option value="$PROJECT_DIR$/SzyxImSdk" />
|
<option value="$PROJECT_DIR$/SzyxImSdk" />
|
||||||
|
<option value="$PROJECT_DIR$/SzyxPushSdk" />
|
||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
@ -50,11 +50,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
// implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
api project(path: ':SzyxImSdk')
|
api project(path: ':SzyxImSdk')
|
||||||
|
api project(path: ':SzyxPushSdk')
|
||||||
implementation 'androidx.appcompat:appcompat:1.4.2'
|
implementation 'androidx.appcompat:appcompat:1.4.2'
|
||||||
implementation 'com.google.android.material:material:1.5.0'
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||||
|
|||||||
二进制文件未显示。
@ -20,8 +20,7 @@
|
|||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.login.LoginActivity"
|
android:name=".ui.login.LoginActivity"
|
||||||
android:exported="true"
|
android:exported="true">
|
||||||
android:label="@string/title_activity_login">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@ -37,6 +36,13 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.FriendsActivity"
|
android:name=".ui.FriendsActivity"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="api_key"
|
||||||
|
android:value="f1915413758c27b8380eee038456b39c"/>
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="app_id"
|
||||||
|
android:value="105654149"/>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@ -10,12 +10,14 @@ import com.xuqm.base.adapter.CommonPagedAdapter;
|
|||||||
import com.xuqm.base.adapter.ViewHolder;
|
import com.xuqm.base.adapter.ViewHolder;
|
||||||
import com.xuqm.base.ui.BaseListFormLayoutActivity;
|
import com.xuqm.base.ui.BaseListFormLayoutActivity;
|
||||||
|
|
||||||
|
import cn.org.bjca.trust.android.imdemo.MyApplication;
|
||||||
import cn.org.bjca.trust.android.imdemo.R;
|
import cn.org.bjca.trust.android.imdemo.R;
|
||||||
import cn.org.bjca.trust.android.imdemo.data.item.MainItem;
|
import cn.org.bjca.trust.android.imdemo.data.item.MainItem;
|
||||||
import cn.org.bjca.trust.android.imdemo.databinding.ActivityMainBinding;
|
import cn.org.bjca.trust.android.imdemo.databinding.ActivityMainBinding;
|
||||||
import cn.org.bjca.trust.android.imdemo.vm.MainVM;
|
import cn.org.bjca.trust.android.imdemo.vm.MainVM;
|
||||||
import cn.org.bjca.trust.android.lib.im.SZYXImSdk;
|
import cn.org.bjca.trust.android.lib.im.SZYXImSdk;
|
||||||
import cn.org.bjca.trust.android.lib.im.kit.IMSDKCallback;
|
import cn.org.bjca.trust.android.lib.im.kit.IMSDKCallback;
|
||||||
|
import cn.org.bjca.trust.android.lib.push.SZYXPushSdk;
|
||||||
|
|
||||||
public class MainActivity extends BaseListFormLayoutActivity<MainItem, MainVM, ActivityMainBinding> {
|
public class MainActivity extends BaseListFormLayoutActivity<MainItem, MainVM, ActivityMainBinding> {
|
||||||
|
|
||||||
@ -29,6 +31,7 @@ public class MainActivity extends BaseListFormLayoutActivity<MainItem, MainVM, A
|
|||||||
super.initView(savedInstanceState);
|
super.initView(savedInstanceState);
|
||||||
showBack(false);
|
showBack(false);
|
||||||
setTitleText("工作台");
|
setTitleText("工作台");
|
||||||
|
SZYXPushSdk.getInstance().init(MyApplication.getInstance());
|
||||||
setConfirmText("退出", v -> SZYXImSdk.getInstance().logout(new IMSDKCallback() {
|
setConfirmText("退出", v -> SZYXImSdk.getInstance().logout(new IMSDKCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void success() {
|
public void success() {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">ImAndroid</string>
|
<string name="app_name">推送demo</string>
|
||||||
<string name="title_activity_login">LoginActivity</string>
|
<string name="title_activity_login">LoginActivity</string>
|
||||||
<string name="prompt_email">Phone</string>
|
<string name="prompt_email">Phone</string>
|
||||||
<string name="prompt_password">Password</string>
|
<string name="prompt_password">Password</string>
|
||||||
|
|||||||
@ -27,3 +27,4 @@ dependencyResolutionManagement {
|
|||||||
rootProject.name = "ImAndroid"
|
rootProject.name = "ImAndroid"
|
||||||
include ':app'
|
include ':app'
|
||||||
include ':SzyxImSdk'
|
include ':SzyxImSdk'
|
||||||
|
include ':SzyxPushSdk'
|
||||||
|
|||||||
1
szyxpushsdk/.gitignore
vendored
普通文件
1
szyxpushsdk/.gitignore
vendored
普通文件
@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
37
szyxpushsdk/build.gradle
普通文件
37
szyxpushsdk/build.gradle
普通文件
@ -0,0 +1,37 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace 'cn.org.bjca.trust.android.lib.push'
|
||||||
|
compileSdk 33
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk 24
|
||||||
|
targetSdk 33
|
||||||
|
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
consumerProguardFiles "consumer-rules.pro"
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.2'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||||
|
|
||||||
|
}
|
||||||
二进制文件未显示。
21
szyxpushsdk/proguard-rules.pro
vendored
普通文件
21
szyxpushsdk/proguard-rules.pro
vendored
普通文件
@ -0,0 +1,21 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package cn.org.bjca.trust.android.lib.push;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumented test, which will execute on an Android device.
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class ExampleInstrumentedTest {
|
||||||
|
@Test
|
||||||
|
public void useAppContext() {
|
||||||
|
// Context of the app under test.
|
||||||
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
|
assertEquals("cn.org.bjca.trust.android.lib.push.test", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application>
|
||||||
|
<!--push应用定义消息receiver声明-->
|
||||||
|
<receiver android:name=".push.PushMessageReceiverImpl"
|
||||||
|
android:exported="false">
|
||||||
|
<intent-filter>
|
||||||
|
<!--接收push消息-->
|
||||||
|
<action android:name="com.vivo.pushclient.action.RECEIVE"/>
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
<!--Vivo Push需要配置的service、activity-->
|
||||||
|
<service
|
||||||
|
android:name="com.vivo.push.sdk.service.CommandClientService"
|
||||||
|
android:permission="com.push.permission.UPSTAGESERVICE"
|
||||||
|
android:exported="true"/>
|
||||||
|
</application>
|
||||||
|
</manifest>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package cn.org.bjca.trust.android.lib.push;
|
||||||
|
|
||||||
|
import cn.org.bjca.trust.android.lib.push.kit.PushInterface;
|
||||||
|
import cn.org.bjca.trust.android.lib.push.push.SZYXPushManager;
|
||||||
|
|
||||||
|
public class SZYXPushSdk {
|
||||||
|
private static final class PushHolder {
|
||||||
|
static final PushInterface instance = new SZYXPushManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PushInterface getInstance() {
|
||||||
|
return PushHolder.instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package cn.org.bjca.trust.android.lib.push.kit;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
public interface PushInterface {
|
||||||
|
void init(Context mContext);
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package cn.org.bjca.trust.android.lib.push.push;
|
||||||
|
|
||||||
|
import com.vivo.push.sdk.OpenClientPushMessageReceiver;
|
||||||
|
|
||||||
|
public class PushMessageReceiverImpl extends OpenClientPushMessageReceiver {
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package cn.org.bjca.trust.android.lib.push.push;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.vivo.push.PushClient;
|
||||||
|
import com.vivo.push.util.VivoPushException;
|
||||||
|
|
||||||
|
import cn.org.bjca.trust.android.lib.push.kit.PushInterface;
|
||||||
|
|
||||||
|
public class SZYXPushManager implements PushInterface {
|
||||||
|
@Override
|
||||||
|
public void init(Context mContext) {
|
||||||
|
//初始化push
|
||||||
|
try {
|
||||||
|
PushClient.getInstance(mContext).initialize();
|
||||||
|
} catch (VivoPushException e) {
|
||||||
|
Log.e("=====>0", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开push开关, 关闭为turnOffPush,详见api接入文档
|
||||||
|
PushClient.getInstance(mContext).turnOnPush(state -> {
|
||||||
|
Log.e("=====>1", state + "");
|
||||||
|
Log.e("=====>2", PushClient.getInstance(mContext).getRegId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package cn.org.bjca.trust.android.lib.push;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example local unit test, which will execute on the development machine (host).
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
public class ExampleUnitTest {
|
||||||
|
@Test
|
||||||
|
public void addition_isCorrect() {
|
||||||
|
assertEquals(4, 2 + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
正在加载...
在新工单中引用
屏蔽一个用户