|
|
@@ -4,16 +4,29 @@ import android.Manifest;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
import android.content.pm.PackageManager;
|
|
|
+import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.util.Log;
|
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
+import com.google.gson.GsonBuilder;
|
|
|
+
|
|
|
+import org.json.JSONException;
|
|
|
+import org.json.JSONObject;
|
|
|
+
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
import io.reactivex.disposables.CompositeDisposable;
|
|
|
import io.reactivex.schedulers.Schedulers;
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.application.App;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.PushBean;
|
|
|
import kr.co.zumo.app.lifeplus.model.SuperModel;
|
|
|
+import kr.co.zumo.app.lifeplus.model.SuperModelInit;
|
|
|
import kr.co.zumo.app.lifeplus.network.NetworkWatcher;
|
|
|
+import kr.co.zumo.app.lifeplus.supervisor.ActivityDeliveryHelper;
|
|
|
+import kr.co.zumo.app.lifeplus.supervisor.PushMessageManager;
|
|
|
import kr.co.zumo.app.lifeplus.util.PermissionUtil;
|
|
|
|
|
|
/**
|
|
|
@@ -36,10 +49,42 @@ public class SplashActivity extends ActivityBaseSetup {
|
|
|
|
|
|
Context context = App.getInstance().getContext();
|
|
|
|
|
|
+ // has push message ?
|
|
|
+ Bundle bundle = getIntent().getExtras();
|
|
|
+ if (null != bundle) {
|
|
|
+ // push message 는 pageId 가 있어야한다.
|
|
|
+ if(bundle.get("pageId") != null ) {
|
|
|
+ Log.d("APP# SplashActivity | setup", "| extras: " + bundle);
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ Set<String> keys = bundle.keySet();
|
|
|
+ for (String key : keys) {
|
|
|
+ try {
|
|
|
+ json.put(key, JSONObject.wrap(bundle.get(key)));
|
|
|
+ } catch (JSONException e) {
|
|
|
+ //Handle exception here
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Gson gson = new GsonBuilder().create();
|
|
|
+
|
|
|
+ PushBean bean = gson.fromJson(json.toString(), PushBean.class);
|
|
|
+ Log.d("APP# SplashActivity | setup", "|" + bean.toJson());
|
|
|
+
|
|
|
+ SuperModelInit.instant(getApplicationContext());
|
|
|
+ PushMessageManager.onRecived(bean);
|
|
|
+
|
|
|
+ // fixme PushGateActivity 와 중복되는 부분이 있다.
|
|
|
+ ActivityDeliveryHelper.getInstance().setPackaging(bean);
|
|
|
+ SuperModel.getInstance().setPushLink(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 앱이 실행 중인지 판단한다.
|
|
|
if (SuperModel.getInstance().isAppInitialized()) {
|
|
|
Log.e("APP# SplashActivity | onCreate", "|" + " restart from call...........");
|
|
|
+
|
|
|
finish();
|
|
|
+ doOnLink();
|
|
|
}
|
|
|
else {
|
|
|
Log.e("APP# SplashActivity | onCreate", "|" + " first ...........................");
|