| | |
| | | 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); |
| | |
| | | public static void addLocalNotification(Activity activity, int id, String title, String content, |
| | | long fireTime) |
| | | { |
| | | if (PushEnable) |
| | | { |
| | | try |
| | | { |
| | | JPushLocalNotification ln = new JPushLocalNotification(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static void removeNotification(Activity activity, int id) |
| | | { |
| | | if (PushEnable) |
| | | { |
| | | JPushInterface.removeLocalNotification(activity, id); |
| | | } |
| | | } |
| | | |
| | | public static void GetExternalStorage() |
| | |
| | | return; |
| | | } |
| | | |
| | | PushEnable = activity.getPackageName().equals("com.lingleigame.shaonianqixiachuan"); |
| | | |
| | | new Thread(new Runnable() |
| | | { |
| | | @Override |
| | |
| | | UniversalUtil.sendMessageToUnity(_msgStruct); |
| | | |
| | | // ------------------------------- 极光推送 ------------------------------- |
| | | String _registrationID = "0"; |
| | | if (PushEnable) |
| | | { |
| | | JPushInterface.setDebugMode(true); |
| | | JPushInterface.init(activity); |
| | | |
| | |
| | | // 等待获取极光registrationID |
| | | if (!JPushInterface.getRegistrationID(activity).equals("")) |
| | | { |
| | | _registrationID = JPushInterface.getRegistrationID(activity); |
| | | break; |
| | | } |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | _msgStruct.clear(); |
| | | _msgStruct.put("code", CodeA2U.PushClientID); |
| | | _msgStruct.put("clientID", JPushInterface.getRegistrationID(activity)); |
| | | _msgStruct.put("clientID", _registrationID); |
| | | UniversalUtil.sendMessageToUnity(_msgStruct); |
| | | |
| | | _msgStruct.clear(); |
| | |
| | | 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); |
| | |
| | | MrPlatformUtil.getInstance().pay(_activity, |
| | | _json.getString("cpInfo"), |
| | | _json.getString("roleID"), |
| | | _json.getString("roleName").trim().replace(" ",""), |
| | | _json.getString("roleName").trim().replace(" ", |
| | | ""), |
| | | _json.getString("level"), |
| | | _extraData.toString(), |
| | | _json.getString("sid"), |
| | |
| | | MrPlatformUtil.getInstance().createRole(_activity, |
| | | _json.getString("roleID"), |
| | | _json.getString("sid"), |
| | | _json.getString("roleName").trim().replace(" ",""), |
| | | _json.getString( |
| | | "roleName").trim().replace(" ", |
| | | ""), |
| | | "1", |
| | | "0"); |
| | | break; |
| | |
| | | MrPlatformUtil.getInstance().enterWorld(_activity, |
| | | _json.getString("roleID"), |
| | | _json.getString("sid"), |
| | | _json.getString("roleName").trim().replace(" ",""), |
| | | _json.getString( |
| | | "roleName").trim().replace(" ", |
| | | ""), |
| | | _json.getString("level"), |
| | | _json.getString("vipLevel")); |
| | | break; |
| | |
| | | public static void addLocalNotification(Activity activity, int id, String title, String content, |
| | | long fireTime) |
| | | { |
| | | if (PushEnable) |
| | | { |
| | | try |
| | | { |
| | | JPushLocalNotification ln = new JPushLocalNotification(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static void removeNotification(Activity activity, int id) |
| | | { |
| | | if (PushEnable) |
| | | { |
| | | JPushInterface.removeLocalNotification(activity, id); |
| | | } |
| | | } |
| | | |
| | | public static void GetExternalStorage() |
| | |
| | | return; |
| | | } |
| | | |
| | | PushEnable = activity.getPackageName().equals("com.ziyouyouxi08.snxxz"); |
| | | |
| | | new Thread(new Runnable() |
| | | { |
| | | @Override |
| | |
| | | UniversalUtil.sendMessageToUnity(_msgStruct); |
| | | |
| | | // ------------------------------- 极光推送 ------------------------------- |
| | | String _registrationID = "0"; |
| | | if (PushEnable) |
| | | { |
| | | JPushInterface.setDebugMode(true); |
| | | JPushInterface.init(activity); |
| | | |
| | |
| | | // 等待获取极光registrationID |
| | | if (!JPushInterface.getRegistrationID(activity).equals("")) |
| | | { |
| | | _registrationID = JPushInterface.getRegistrationID(activity); |
| | | break; |
| | | } |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | _msgStruct.clear(); |
| | | _msgStruct.put("code", CodeA2U.PushClientID); |
| | | _msgStruct.put("clientID", JPushInterface.getRegistrationID(activity)); |
| | | _msgStruct.put("clientID", _registrationID); |
| | | UniversalUtil.sendMessageToUnity(_msgStruct); |
| | | |
| | | _msgStruct.clear(); |
| | |
| | | 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); |
| | |
| | | SpPlatformUtil.getInstance().createRole(_json.getString("sid"), |
| | | _json.getString("serverName"), |
| | | _json.getString("roleID"), |
| | | _json.getString("roleName").trim().replace(" ",""), |
| | | _json.getString( |
| | | "roleName").trim().replace(" ", |
| | | ""), |
| | | _json.getString("level"), |
| | | _json.getString("familyName").trim().replace(" ",""), |
| | | _json.getString( |
| | | "familyName").trim().replace( |
| | | " ", ""), |
| | | _json.getString("gameName"), |
| | | _json.getString("job"), |
| | | _json.getString("vipLevel"), |
| | |
| | | SpPlatformUtil.getInstance().enterWorld(_json.getString("sid"), |
| | | _json.getString("serverName"), |
| | | _json.getString("roleID"), |
| | | _json.getString("roleName").trim().replace(" ",""), |
| | | _json.getString( |
| | | "roleName").trim().replace(" ", |
| | | ""), |
| | | _json.getString("level"), |
| | | _json.getString("familyName").trim().replace(" ",""), |
| | | _json.getString( |
| | | "familyName").trim().replace( |
| | | " ", ""), |
| | | _json.getString("gameName"), |
| | | _json.getString("job"), |
| | | _json.getString("vipLevel"), |
| | |
| | | SpPlatformUtil.getInstance().levelUp(_json.getString("sid"), |
| | | _json.getString("serverName"), |
| | | _json.getString("roleID"), |
| | | _json.getString("roleName").trim().replace(" ",""), |
| | | _json.getString("roleName").trim().replace( |
| | | " ", ""), |
| | | _json.getString("level"), |
| | | _json.getString("familyName").trim().replace(" ",""), |
| | | _json.getString( |
| | | "familyName").trim().replace(" ", |
| | | ""), |
| | | _json.getString("gameName"), |
| | | _json.getString("job"), |
| | | _json.getString("vipLevel"), |
| | |
| | | public static void addLocalNotification(Activity activity, int id, String title, String content, |
| | | long fireTime) |
| | | { |
| | | if (PushEnable) |
| | | { |
| | | try |
| | | { |
| | | JPushLocalNotification ln = new JPushLocalNotification(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static void removeNotification(Activity activity, int id) |
| | | { |
| | | if (PushEnable) |
| | | { |
| | | JPushInterface.removeLocalNotification(activity, id); |
| | | } |
| | | } |
| | | |
| | | public static void GetExternalStorage() |
| | |
| | | return; |
| | | } |
| | | |
| | | PushEnable = activity.getPackageName().equals("com.xjaz.sp"); |
| | | |
| | | new Thread(new Runnable() |
| | | { |
| | | @Override |
| | |
| | | UniversalUtil.sendMessageToUnity(_msgStruct); |
| | | |
| | | // ------------------------------- 极光推送 ------------------------------- |
| | | String _registrationID = "0"; |
| | | if (PushEnable) |
| | | { |
| | | JPushInterface.setDebugMode(true); |
| | | JPushInterface.init(activity); |
| | | |
| | |
| | | // 等待获取极光registrationID |
| | | if (!JPushInterface.getRegistrationID(activity).equals("")) |
| | | { |
| | | _registrationID = JPushInterface.getRegistrationID(activity); |
| | | break; |
| | | } |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | _msgStruct.clear(); |
| | | _msgStruct.put("code", CodeA2U.PushClientID); |
| | | _msgStruct.put("clientID", JPushInterface.getRegistrationID(activity)); |
| | | _msgStruct.put("clientID", _registrationID); |
| | | UniversalUtil.sendMessageToUnity(_msgStruct); |
| | | |
| | | _msgStruct.clear(); |