client_Hale
2018-10-12 1a9012be7aff5b5cf1d03795fcfa1740c6a6f9cf
Project/js_sdk/src/game_jisugame/java/com/secondworld/univeralsdk/H2EngineSDK.java
@@ -33,6 +33,8 @@
    private static final String TAG = "H2EngineSDK";
    private static String APP_ID = "";
    private static boolean PushEnable = true;
    public static void HandleUnityMessage(String json)
    {
        LogUtil.i(TAG, "收到Unity发来的信息: " + json);
@@ -145,6 +147,8 @@
    public static void addLocalNotification(Activity activity, int id, String title, String content,
                                            long fireTime)
    {
        if (PushEnable)
        {
        try
        {
            JPushLocalNotification ln = new JPushLocalNotification();
@@ -160,10 +164,14 @@
            e.printStackTrace();
        }
    }
    }
    public static void removeNotification(Activity activity, int id)
    {
        if (PushEnable)
        {
        JPushInterface.removeLocalNotification(activity, id);
        }
    }
    public static void GetExternalStorage()
@@ -275,6 +283,8 @@
            return;
        }
        PushEnable = activity.getPackageName().equals("com.lingleigame.shaonianqixiachuan");
        new Thread(new Runnable()
        {
            @Override
@@ -298,6 +308,9 @@
                UniversalUtil.sendMessageToUnity(_msgStruct);
                // ------------------------------- 极光推送 -------------------------------
                String _registrationID = "0";
                if (PushEnable)
                {
                JPushInterface.setDebugMode(true);
                JPushInterface.init(activity);
@@ -308,6 +321,7 @@
                    // 等待获取极光registrationID
                    if (!JPushInterface.getRegistrationID(activity).equals(""))
                    {
                            _registrationID = JPushInterface.getRegistrationID(activity);
                        break;
                    }
@@ -319,10 +333,11 @@
                        break;
                    }
                }
                }
                _msgStruct.clear();
                _msgStruct.put("code", CodeA2U.PushClientID);
                _msgStruct.put("clientID", JPushInterface.getRegistrationID(activity));
                _msgStruct.put("clientID", _registrationID);
                UniversalUtil.sendMessageToUnity(_msgStruct);
                _msgStruct.clear();