This commit is contained in:
18142669586 2022-08-17 13:34:29 +08:00
parent 121e07f915
commit 2c248681ca
9 changed files with 55 additions and 11 deletions

View File

@ -91,6 +91,14 @@
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:replace="theme,label,icon,allowBackup"> tools:replace="theme,label,icon,allowBackup">
<service
android:name="io.rong.push.platform.google.RongFirebaseMessagingService"
android:stopWithTask="false"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<activity <activity
android:name="com.shayu.phonelive.activity.LauncherActivity" android:name="com.shayu.phonelive.activity.LauncherActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
@ -144,6 +152,12 @@
android:name="com.facebook.sdk.ClientToken" android:name="com.facebook.sdk.ClientToken"
android:value="@string/facebook_client_token" /> android:value="@string/facebook_client_token" />
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/> <meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/>
<meta-data
android:name="firebase_messaging_auto_init_enabled"
android:value="false" />
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
</application> </application>
</manifest> </manifest>

View File

@ -41,6 +41,8 @@ import io.rong.imlib.IRongCoreListener;
import io.rong.imlib.RongIMClient; import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation; import io.rong.imlib.model.Conversation;
import io.rong.message.TextMessage; import io.rong.message.TextMessage;
import io.rong.push.RongPushClient;
import io.rong.push.pushconfig.PushConfig;
import static com.yunbao.live.socket.SocketClient.mSocketHandler; import static com.yunbao.live.socket.SocketClient.mSocketHandler;
@ -116,6 +118,12 @@ public class AppContext extends CommonAppContext {
} }
ARouter.init(this); ARouter.init(this);
//谷歌推送
PushConfig gconfig = new PushConfig.Builder()
.enableFCM(true)
.build();
RongPushClient.setPushConfig(gconfig);
//初始化 邀请码库 //初始化 邀请码库
if (isMainProcess()) { if (isMainProcess()) {
OpenInstall.init(this); OpenInstall.init(this);

View File

@ -166,7 +166,6 @@ dependencies {
api 'com.linecorp:linesdk:5.0.1' api 'com.linecorp:linesdk:5.0.1'
api 'com.adjust.sdk:adjust-android:4.30.1' api 'com.adjust.sdk:adjust-android:4.30.1'
api 'com.android.installreferrer:installreferrer:2.2' api 'com.android.installreferrer:installreferrer:2.2'
api 'com.google.firebase:firebase-analytics:15.0.0'
//Retrofit2库 //Retrofit2库
api 'com.squareup.retrofit2:retrofit:2.3.0' api 'com.squareup.retrofit2:retrofit:2.3.0'
api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
@ -177,4 +176,7 @@ dependencies {
api 'com.jakewharton.rxbinding3:rxbinding:3.1.0' api 'com.jakewharton.rxbinding3:rxbinding:3.1.0'
//loading样式库 //loading样式库
api 'com.wang.avi:library:2.1.3' api 'com.wang.avi:library:2.1.3'
api 'com.google.firebase:firebase-messaging:23.0.6'
api 'com.google.firebase:firebase-analytics:21.1.0'
} }

View File

@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit;
import io.reactivex.Observer; import io.reactivex.Observer;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import kotlin.Unit; import kotlin.*;
/** /**
* View防抖 * View防抖

View File

@ -21,6 +21,7 @@ import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -31,6 +32,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.android.billingclient.api.Purchase; import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.SkuDetails; import com.android.billingclient.api.SkuDetails;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.jakewharton.rxbinding3.view.RxView; import com.jakewharton.rxbinding3.view.RxView;
@ -122,10 +126,9 @@ import cn.rongcloud.rtc.api.RCRTCEngine;
import io.reactivex.Observer; import io.reactivex.Observer;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.rong.imlib.RongIMClient; import io.rong.imlib.RongIMClient;
import kotlin.Unit;
import static com.yunbao.common.CommonAppContext.isReady; import static com.yunbao.common.CommonAppContext.isReady;
import kotlin.*;
@Route(path = RouteUtil.PATH_MAIN) @Route(path = RouteUtil.PATH_MAIN)
public class MainActivity extends AbsActivity implements MainAppBarLayoutListener { public class MainActivity extends AbsActivity implements MainAppBarLayoutListener {
@ -270,11 +273,27 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
Display mDisplay = getWindowManager().getDefaultDisplay(); Display mDisplay = getWindowManager().getDefaultDisplay();
Height = mDisplay.getHeight(); Height = mDisplay.getHeight();
// IMLib 初始化 // IMLib 初始化
RongIMClient.init(this, RongcloudIMManager.RONG_IM_KEY); RongIMClient.init(this, RongcloudIMManager.RONG_IM_KEY,true);
// RTCLib 初始化 // RTCLib 初始化
RCRTCConfig.Builder config = RCRTCConfig.Builder.create(); RCRTCConfig.Builder config = RCRTCConfig.Builder.create();
RCRTCEngine.getInstance().init(MainActivity.this, config.build()); RCRTCEngine.getInstance().init(MainActivity.this, config.build());
// FirebaseMessaging.getInstance().getToken()
// .addOnCompleteListener(new OnCompleteListener<String>() {
// @Override
// public void onComplete(@NonNull Task<String> task) {
// if (!task.isSuccessful()) {
// Log.w(TAG, "Fetching FCM registration token failed", task.getException());
// return;
// }
//
// // Get new FCM registration token
// String token = task.getResult();
//
// // Log and toast
// Log.d(TAG, token);
// Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT).show();
// }
// });
boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false); boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false);
mRootView = (ViewGroup) findViewById(R.id.rootView); mRootView = (ViewGroup) findViewById(R.id.rootView);
floatBanner = findViewById(R.id.float_banner_home); floatBanner = findViewById(R.id.float_banner_home);
@ -380,7 +399,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} }
@Override @Override
public void onNext(Unit unit) { public void onNext(kotlin.Unit unit) {
String Uid = floatBanner.getUid(); String Uid = floatBanner.getUid();
LiveHttpUtil.getLiveInfo(Uid + "", new HttpCallback() { LiveHttpUtil.getLiveInfo(Uid + "", new HttpCallback() {
@Override @Override

View File

@ -127,7 +127,7 @@ public class MyWebViewActivity extends AbsActivity {
mWebView.setWebViewClient(new WebViewClient() { mWebView.setWebViewClient(new WebViewClient() {
@Override @Override
public boolean shouldOverrideUrlLoading(WebView view, String url) { public boolean shouldOverrideUrlLoading(WebView view, String url) {
L.e("H5-------->" + url); L.e("H5--------1>" + url);
if (url.startsWith(Constants.COPY_PREFIX)) { if (url.startsWith(Constants.COPY_PREFIX)) {
String content = url.substring(Constants.COPY_PREFIX.length()); String content = url.substring(Constants.COPY_PREFIX.length());
if (!TextUtils.isEmpty(content)) { if (!TextUtils.isEmpty(content)) {

View File

@ -100,7 +100,7 @@ public class MyWebViewActivity2 extends AbsActivity {
mWebView.setWebViewClient(new WebViewClient() { mWebView.setWebViewClient(new WebViewClient() {
@Override @Override
public boolean shouldOverrideUrlLoading(WebView view, String url) { public boolean shouldOverrideUrlLoading(WebView view, String url) {
L.e("H5-------->" + url); L.e("H5--------1>" + url);
if (url.startsWith(Constants.COPY_PREFIX)) { if (url.startsWith(Constants.COPY_PREFIX)) {
String content = url.substring(Constants.COPY_PREFIX.length()); String content = url.substring(Constants.COPY_PREFIX.length());
if (!TextUtils.isEmpty(content)) { if (!TextUtils.isEmpty(content)) {

View File

@ -150,6 +150,7 @@ public class ZhuangBanActivity extends AbsActivity {
}); });
mWebView.getSettings().setJavaScriptEnabled(true); // 是否开启JS支持 mWebView.getSettings().setJavaScriptEnabled(true); // 是否开启JS支持
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口 mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.addJavascriptInterface(new JsInteration(), "androidObject"); mWebView.addJavascriptInterface(new JsInteration(), "androidObject");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
@ -336,7 +337,7 @@ public class ZhuangBanActivity extends AbsActivity {
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
} }
Intent intent = new Intent(context, ZhuangBanActivity.class); Intent intent = new Intent(context, ZhuangBanActivity.class);
Log.i("tag", url); Log.i("tag1212", url);
intent.putExtra(Constants.URL, url); intent.putExtra(Constants.URL, url);
context.startActivity(intent); context.startActivity(intent);
} }

View File

@ -569,7 +569,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
if (!bean.getSlide_url().equals("")) { if (!bean.getSlide_url().equals("")) {
Constants.isTitle = true; Constants.isTitle = true;
String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
ZhuangBanActivity.forward(mContext, url, false); WebViewActivity.forward(mContext, url, false);
} }
} }
} }