* Mercury open/close result
typedef enum _MERCURY_RESULT { // Mercury full banner & main page MERCURY_OPEN = 1, // 모듈 Full Banner 웹뷰 열림 알림 MERCURY_CLOSE = 2, // 모듈 Full Banner 웹뷰 닫힘 알림 MERCURY_FORCED_OPEN = 3, // 모듈 Main Page 웹뷰 열림 알림 MERCURY_FORCED_CLOSE = 4, // 모듈 Main Page 웹뷰 닫힘 알림 MERCURY_NOTICE_OPEN = 5, // 모듈 Notice Only 웹뷰 열림 알림 MERCURY_NOTICE_CLOSE = 6, // 모듈 Notice Only 웹뷰 닫힘 알림 // Custom board & view MERCURY_CUSTOM_OPEN = 7, // 모듈 Custom board 뷰 열림 알림 MERCURY_CUSTOM_CLOSE = 8, // 모듈 Custom board 뷰 닫힘 알림 MERCURY_CUSTOM_BOARD_OPEN = MERCURY_CUSTOM_OPEN, MERCURY_CUSTOM_BOARD_CLOSE = MERCURY_CUSTOM_CLOSE, MERCURY_CUSTOM_VIEW_OPEN = 9, // 모듈 Custom 웹뷰 열림 알림 MERCURY_CUSTOM_VIEW_CLOSE = 10, // 모듈 Custom 웹뷰 닫힘 알림 // Review popup MERCURY_REVIEW_OPEN = 11, // 리뷰 팝업 열림 알림 MERCURY_REVIEW_CLOSE = 12, // 리뷰 팝업 닫힘 알림 // Moregames popup (Android Only) MERCURY_MOREGAMES_OPEN = 13, // 모어게임즈 팝업 열림 알림 MERCURY_MOREGAMES_CLOSE = 14, // 모어게임즈 팝업 닫힘 알림 MERCURY_MOREGAMES_CLOSE_WITH_APP_TERMINATION = 15, // 모어게임즈 팝업 닫힘 & 사용자가 앱 종료하기 선택함 알림 // Network error MERCURY_NETWORK_DISCONNECT = 16 // 네트워크 접속장애 알림 // YouTube Video Promotion MERCURY_START_PLAYBACK = 17 // 동영상 재생 시작을 알림 MERCURY_FINISH_PLAYBACK = 18 // 동영상 재생 종료를 알림 // 스키마를 통한 창 닫는 기능 - added Android Mercury 2.13.2, iOS Mercury 2.13.3 MERCURY_MAIN_GOBACK = 19, // 프로모션 페이지 뒤로 가기 닫힘 (Main Page) MERCURY_NOTICE_GOBACK = 20, // 프로모션 페이지 뒤로 가기 닫힘 (Notice) MERCURY_CUSTOM_BOARD_GOBACK = 21, // 프로모션 페이지 뒤로 가기 닫힘 (Board) MERCURY_CUSTOM_VIEW_GOBACK = 22 // 프로모션 페이지 뒤로 가기 닫힘 (CustomView) } MERCURY_RESULT; |
* Get CustomViewInfo result
typedef enum _MERCURY_CUSTOM_RESULT { MERCURY_SUCCESS = 0, MERCURY_FAILED = -1 MERCURY_INVALID_PARAM = -2 // added Android Mercury 2.12.7, iOS Mercury 2.12.8 } MERCURY_CUSTOM_RESULT; |
* Mercury Show type
typedef enum _MERCURY_SHOW_TYPE { // Mercury full banner MERCURY_SHOW_EVENT_LEGACY = -9, // Full Banner(Webview) (Android Mercury v2.14.0+, iOS Mercury v2.14.0+) MERCURY_SHOW_EVENT = -11, // Full Banner // Mercury main page MERCURY_SHOW_NOTICE_TOP = -12, // Main Page (공지사항 위쪽 배치) MERCURY_SHOW_NOTICE_BOTTOM = -13, // Main Page (공지사항 아래쪽 배치) MERCURY_SHOW_FORCED_NOTICE_TOP = -14, // Main Page (공지사항 위쪽 배치 + 하루안보기 무시) MERCURY_SHOW_FORCED_NOTICE_BOTTOM = -15, // Main Page (공지사항 아래쪽 배치 + 하루안보기 무시) // Mercury notice MERCURY_SHOW_NOTICE_ONLY = -16, // Notice Only (공지사항만 표시) MERCURY_SHOW_FORCED_NOTICE_ONLY = -17, // Notice Only (공지사항만 표시 + 하루안보기 무시) // Custom show type // Base <= type < MAX MERCURY_SHOW_CUSTOM_BASE = 100000, // Custom board MERCURY_SHOW_CUSTOM_BOARD_BASE = MERCURY_SHOW_CUSTOM_BASE, MERCURY_SHOW_CUSTOM_BOARD_MAX = MERCURY_SHOW_CUSTOM_BASE + 200000, MERCURY_SHOW_CUSTOM_VIEW_BASE = MERCURY_SHOW_CUSTOM_BOARD_MAX, MERCURY_SHOW_CUSTOM_VIEW_MAX = MERCURY_SHOW_CUSTOM_VIEW_BASE + 200000 } MERCURY_SHOW_TYPE; |
* Badge request & response code
typedef enum _MERCURY_BADGE_TARGET { MERCURY_BADGE_FOR_EVENT = -20, // Badge for 'Full banner' MERCURY_BADGE_FOR_NOTICE = -21, // Badge for 'Main page' MERCURY_BADGE_FOR_NOTICE_ONLY = -22, // Badge for 'Notice Only' MERCURY_BADGE_FOR_NONE = -23, // Badge not found // Custom board & view // Base <= target < MAX MERCURY_BADGE_FOR_CUSTOM_BASE = 100000, MERCURY_BADGE_FOR_CUSTOM = MERCURY_BADGE_FOR_CUSTOM_BASE, MERCURY_BADGE_FOR_CUSTOM_MAX = MERCURY_BADGE_FOR_CUSTOM_BASE + 200000, MERCURY_BADGE_FOR_CUSTOM_BOARD_BASE = MERCURY_BADGE_FOR_CUSTOM_BASE, MERCURY_BADGE_FOR_CUSTOM_BOARD_MAX = MERCURY_BADGE_FOR_CUSTOM_MAX, MERCURY_BADGE_FOR_CUSTOM_VIEW_BASE = MERCURY_BADGE_FOR_CUSTOM_BOARD_MAX, MERCURY_BADGE_FOR_CUSTOM_VIEW_MAX = MERCURY_BADGE_FOR_CUSTOM_VIEW_BASE + 200000 } MERCURY_BADGE_TARGET; |
* Badge type
typedef enum _MERCURY_BADGE_TYPE { MERCURY_BADGE_TYPE_NONE = -24, MERCURY_BADGE_TYPE_NEW = -25, MERCURY_BADGE_TYPE_MAX = -26 } MERCURY_BADGE_TYPE; |
* Java source / C# source only
public class Mercury { // Mercury Badge Type public static final int MERCURY_BADGE_TYPE_NEW = -20; public static final int MERCURY_BADGE_TYPE_MAX = -21; // Mercury Callback for Default Action public static final int MERCURY_FULL_BANNER_OPENED = -6; public static final int MERCURY_FULL_BANNER_CLOSED = -7; public static final int MERCURY_MAIN_PAGE_OPENED = -8; public static final int MERCURY_MAIN_PAGE_CLOSED = -9; public static final int MERCURY_NOTICE_ONLY_OPENED = -10; public static final int MERCURY_NOTICE_ONLY_CLOSED = -11; public static final int MERCURY_CUSTOM_OPENED = -12; public static final int MERCURY_CUSTOM_CLOSED = -13; public static final int MERCURY_NETWORK_DISCONNECTED = -14; // Mercury Badge For What public static final int MERCURY_BADGE_FOR_ALL = 0; public static final int MERCURY_BADGE_FOR_FULL_BANNER = -15; public static final int MERCURY_BADGE_FOR_MAIN_PAGE = -16; public static final int MERCURY_BADGE_FOR_NOTICE_ONLY = -17; public static final int MERCURY_BADGE_FOR_CUSTOM_BASE = 100000; public static final int MERCURY_BADGE_FOR_CUSTOM_NEW = MERCURY_BADGE_FOR_CUSTOM_BASE; public static final int MERCURY_BADGE_FOR_CUSTOM_MAX = MERCURY_BADGE_FOR_CUSTOM_BASE+200000; // Mercury Show Type public static final int MERCURY_GET_BADGE_LIST = -10; public static final int MERCURY_SHOW_EVENT = -11; public static final int MERCURY_SHOW_NOTICE_TOP = -12; public static final int MERCURY_SHOW_NOTICE_BOTTOM = -13; public static final int MERCURY_SHOW_FORCED_NOTICE_TOP = -14; public static final int MERCURY_SHOW_FORCED_NOTICE_BOTTOM = -15; public static final int MERCURY_SHOW_NOTICE_ONLY = -16; public static final int MERCURY_SHOW_FORCED_NOTICE_ONLY = -17; public static final int MERCURY_SHOW_CUSTOM_BASE = 100000; public static final int MERCURY_SHOW_FORCED_CUSTOM_BASE = 200000; } |
void |
in/out | Type | Name | Description |
---|---|---|---|
in | MercuryCB | callback |
Callback을 받는 함수입니다. |
void |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | uid |
uid를 설정합니다. (CS_MercurySetUid에서 설정한 값과 동일합니다.) |
in | MERCURY_SHOW_TYPE | mercuryShowType |
Show Type을 설정합니다. (상단의 Type enum값 참고) |
in | const char* | additionalInfo |
server로 전달 할 추가 정보를 Json형식으로 넘깁니다.
mq_redirect를 사용하면 머큐리 백오피스에서 등록한 (이벤트 번호를 부여받은) 특정 이벤트 페이지의 URL을 바로 출력 할 수 있다.
|
MERCURY_CUSTOM_RESULT (SUCCESS, FAILED) |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | uid |
uid를 설정합니다. (CS_MercurySetUid에서 설정한 값과 동일합니다.) |
in | int | viewID |
Custom Info를 요청 할 viewID(ShowType)입니다. |
in | MercuryCBWIthData | customViewCallback |
결과 Data를 전달 받을 Callback을 지정합니다. |
0 : Request success. |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | uid |
UID 입니다. |
in | const char* | vid |
VID 입니다. |
in | const char* | did |
DID 입니다. |
0 : Request success. |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | uid |
UID 입니다. |
in | const char* | vid |
VID 입니다. |
in | const char* | did |
DID 입니다. |
MERCURY_CUSTOM_RESULT (SUCCESS, FAILED) |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | uid |
UID 입니다. |
in | const char* | vid |
VID 입니다. |
in | const char* | did |
DID 입니다. |
void |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | uid |
UID. |
void |
in/out | Type | Name | Description |
---|---|---|---|
in | int | isUsingStaging |
테스트 서버 사용 여부를 설정합니다. 기본옵션은 false입니다. |
void |
in/out | Type | Name | Description |
---|---|---|---|
in | int | isLog |
Android Log 설정. 기본 false. iOS에서는 debug library 사용. |
version |
void |
in/out | Type | Name | Description |
---|---|---|---|
in | const int | badgeTarget |
|
Badge Type Enum |
in/out | Type | Name | Description |
---|---|---|---|
in | const int | badgeTarget |
|
MERCURY_SUCCESS |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | uid |
|
in | const char* | additionalInfo |
|
in | MercuryCBWithData | callbackWithData |
|
MERCURY_SUCCESS |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | urlLink |
|
in | const char* | shareMessage |
|
MERCURY_SUCCESS |
in/out | Type | Name | Description |
---|---|---|---|
in | const char* | campaignType |
|
in | const char* | bannerType |
|
in | MercuryCBWithData | bannerInfoCallback |
|
no return value |
in/out | Type | Name | Description |
---|---|---|---|
in | Activity | activity |
Activity |
version |
void |
no parameter
typedef void |
in/out | Type | Name | Description |
---|---|---|---|
in | MERCURY_RESULT | result |
callback |
// iOS / Wrapper mercury callback 함수 예시 void mercuryCB(MERCURY_RESULT result) { switch(result) { case MERCURY_OPEN: NSLog(@"MERCURY_OPEN"); break; case MERCURY_CLOSE: NSLog(@"MERCURY_CLOSE"); break; case MERCURY_FORCED_OPEN: NSLog(@"MERCURY_FORCED_OPEN"); break; case MERCURY_FORCED_CLOSE: NSLog(@"MERCURY_FORCED_CLOSE"); break; case MERCURY_NETWORK_DISCONNECT: NSLog(@"MERCURY_NETWORK_DISCONNECT"); break; case MERCURY_START_PLAYBACK: NSLog(@"MERCURY_START_PLAYBACK"); // set game sound volume off break; case MERCURY_FINISH_PLAYBACK: NSLog(@"MERCURY_FINISH_PLAYBACK"); // set game sound volume on break; default: break; } } |
typedef void |
in/out | Type | Name | Description |
---|---|---|---|
in | MERCURY_RESULT | result |
callback |
in | const char* | additionalInfo |
json string |
// iOS / Wrapper mercury callback with Data 함수 예시 void mercuryCBWithData(MERCURY_RESULT result, const char* jsonData) { NSLog(@"Mercury callback with data : %s", jsonData); switch(result) { case MERCURY_SUCCESS: { if(jsonData == NULL) return; // CString 파싱 NSString *convertStr = [NSString stringWithUTF8String:jsonData]; NSError *error = nil; NSDictionary *dataDict = [NSJSONSerialization JSONObjectWithData:[convertStr dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&error]; if(error) { NSLog(@"%@", [error localizedDescription]); return; } NSLog(@"Parsed dictionary = %@", dataDict); // customViewInfo 콜백 NSDictionary *customViewInfo = [dataDict objectForKey:@"customviewinfo"]; if(customViewInfo) { // 뱃지 정보 // badgetype = new; // expire = 24; (min) // showtype = 200001; // startdate = 1434070800; (sec : interval since1970) // term = 30; (min) NSDictionary *badgeInfo = [customViewInfo objectForKey:@"badge"]; NSLog(@"Badge info : %@", badgeInfo); // URL 정보 얻어오기 NSString *urlStr = [customViewInfo objectForKey:@"url"]; NSURL *url = [NSURL URLWithString:urlStr]; NSLog(@"URL info : %@", url.absoluteString); // Cookies 정보 얻어오기 // (iOS Mercury v2.12.7 이상( Android Mercury v2.12.6 이상)) // (해당 버전부터는 각 OS가 제공하는 Cookie를 사용하지 않기 때문에 Cookie에서 취급되었던 데이터를 post 데이터로 전송해야 한다. 때문에 Cookies에 있는 값을 얻은 후 Mercury 뷰 호출 시 꼭 post 데이터로 넣어서 요청해야 한다.) NSDictionary *cookiesDict = [customViewInfo objectForKey:@"cookies"]; NSLog(@"cookies info : %@", cookiesDict); // Test Webview Loading WebviewTestViewController *webViewController = [[WebviewTestViewController alloc] initWithNibName:@"WebviewTestViewController" bundle:[NSBundle mainBundle]]; [viewControllerSharedInstance presentViewController:webViewController animated:YES completion:^{ NSURL *webURL = [NSURL URLWithString:@"http://test.mercury.com2us.com/test/printCookie"]; NSURLRequest *request = [NSURLRequest requestWithURL:webURL]; webViewController.customURL = url; webViewController.cookiesDict = cookiesDict; [webViewController.webView loadRequest:request]; }]; } // uainfo 콜백 NSDictionary *uainfo = [dataDict objectForKey:@"uainfo"]; if(uainfo) { // 초대 정보 // invite_link = https://ua.withhive.com/ko/ua1585188c?t=1569567736; // invite_message = 최초 접속 시, 무조건 5성 소환권 지급! // result_code = 0 // result_message = success NSString* urlLink = uainfo[@"invite_link"]; NSString* message = uainfo[@"invite_message"]; CS_MercuryRequestUALinkShare([urlLink UTF8String], [message UTF8String]); } } break; case MERCURY_FAILED: break; default: break; } } // iOS / Wrapper mercury callback with Data webview post 예시 - (IBAction)openCustomURL:(id)sender { NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.customURL]; // cookie 값 post 데이터에 추가 NSError* error = nil; NSMutableDictionary* jsonData = [[NSMutableDictionary alloc]init]; [jsonData setObject:self.cookiesDict forKey:@"cookies"]; NSLog(@"webView jsonBody : %@", jsonData); NSData *dataJSon = [NSJSONSerialization dataWithJSONObject:jsonData options:0 error:&error]; // Make url request. [request setHTTPBody:dataJSon]; [request setHTTPMethod:@"POST"]; [self.webView loadRequest:request]; } /** * Android Mercury 모듈의 mercuryGetCustomViewInfo API를 호출하여 커스텀뷰 관련 정보 및 cookies 정보를 받는 예 * (Java 코드로 작성되었습니다.) */ Mercury libMercury; // Mercury 클래스 객체 JSONObject cookiesJson; // 쿠키 데이터를 임시 관리할 객체 String uid = “123456789”; int viewId = 0; //… Mercury 모듈 초기화 등의 로직은 생략 … // [1] // FnMercuryCBWithData 라는 예제 클래스를 구현한 예 // (FnMercuryCBWithData 클래스는 MercuryCBWithData 콜백을 처리하는 역할을 합니다.) private static class FnMercuryCBWithData implements MercuryCBWithData { @Override public void mercuryCallBackWithData(int result, String jsonData) { // TODO Auto-generated method stub if(result == Mercury.MERCURY_SUCCESS) { try { JSONObject jsonObj = new JSONObject(jsonData); // TODO : jsonData에서 게임앱에서 필요한 데이터를 수집합니다. // 그리고 Android Mercury v2.12.6 이상부터는 “cookies” 키 데이터가 추가로 전달되고, // 해당 키 값을 머큐리의 커스텀 뷰 자체 구현 노출 시 포함시켜 호출합니다. JSONObject jsonCustomViewInfo = jsonObj.getJSONObject(“customviewinfo”); cookiesJson = jsonCustomViewInfo.getJSONObject(“cookies”); // 쿠키 데이터를 객체에 보관 } catch(JSONException e) { e.printStackTrace(); } } } } // [2] // getMercuryCustomViewInfo 라는 예제 메서드를 구현한 예 // (getMercuryCustomViewInfo 메서드는 커스텀뷰 정보 API를 호출하는 역할을 합니다.) public void getMercuryCustomViewInfo() { // mercuryGetCustomViewInfo API 호출 libMercury.mercuryGetCustomViewInfo(uid, viewId, new FnMercuryCBWithData()); } // [3] // 커스텀 뷰 정보 응답 결과 예 // (위 Java 코드의 public void mercuryCallBackWithData(int result, String jsonData) 에서 jsonData의 예) /* {"customviewinfo":{"origin":{"error":0,"errormsg":"Success.","count":5,"show":"1","type":"0","webview":[{"pid":"238803","webview_type":"fullbanner","board":"custom","url":"https:\/\/m-mercury.qpyou.cn\/news\/v1_banner","image_url":"","down_url":"","action":"none","margin":0,"wratio":9,"hratio":16,"cpi_type":0,"act":"init","showtype":"-11"},{"pid":"236272","webview_type":"fullbanner","board":"custom","url":"https:\/\/m-mercury.qpyou.cn\/news\/v1_banner","image_url":"","down_url":"","action":"none","margin":0,"wratio":9,"hratio":16,"cpi_type":0,"act":"init","showtype":"-11"},{"pid":"236275","webview_type":"fullbanner","board":"custom","url":"https:\/\/m-mercury.qpyou.cn\/news\/v1_banner","image_url":"","down_url":"","action":"none","margin":0,"wratio":9,"hratio":16,"cpi_type":0,"act":"init","showtype":"-11"},{"pid":"236274","webview_type":"fullbanner","board":"custom","url":"https:\/\/m-mercury.qpyou.cn\/news\/v1_banner","image_url":"","down_url":"","action":"none","margin":0,"wratio":9,"hratio":16,"cpi_type":0,"act":"init","showtype":"-11"},{"pid":"236271","webview_type":"fullbanner","board":"custom","url":"https:\/\/m-mercury.qpyou.cn\/news\/v1_banner","image_url":"","down_url":"","action":"none","margin":0,"wratio":9,"hratio":16,"cpi_type":0,"act":"init","showtype":"-11"}],"badge":[],"use_cutout":true},"url":"https:\/\/m-mercury.qpyou.cn\/news\/v1_banner","cookies":{"peppermint_version":"Hive v.2.7.11","appid":"com.com2us.hivesdk.normal.freefull.google.global.android.common","device":"SM-N920K","platform":"android","os_version":"7.0","hub_ck2":"88e865a0e736f7c4869341c01c7d0cb64ba191dd08237b999629952580dba425tvMgqodTWou3Tg8mLpa\/iQ==","hub_ck3":"6b377893cde771696e2e62a903c4fa42a8379b748c8c810536199558c6b75f38pBe+3\/LDhtYwzkLeut61SjpvcWo\/2vZNyM\/C\/SBvSWU=","did":"541821123","enable_cookie":"no","language":"ko","device_country":"kr","device_model":"SM-N920K","promotion_version":"2.12.7","app_version":"1.18.0","app_version_code":"60","orient":"1","top_type":"event","vid":"129442100","additionalInfo":"","mcc":"450","mnc":"08","forced":"off","advertising_id":"8003f869-36fa-48e6-99f9-fcb5025e7d4c","imei":"352460074750977","is_limit_ad_tracking":"0","hive_country":"KR","timezone":null,"game_language":"ko","server_id":"KR","analytics_id":"gjkDXPyQNYaWQ5bNf6qqdg=="}}} */ // [4] // showCustomViewWithData 라는 예제 메서드를 구현한 예 // (showCustomViewWithData 메서드는 커스텀뷰를 자체 구성한 데이터로 호출하는 역할을 합니다.) public void showCustomViewWithData() { activity.runOnUiThread(new Runnable() { @Override public void run() { JSONObject jsonData = new JSONObject(); // TODO : 게임앱에서 customview 노출 시 필요한 데이터를 셋팅합니다. // 그리고 추가로 Android Mercury v2.12.6 이상을 쓰는 경우 mercuryGetCustomViewInfo API에서 응답받은 cookies 데이터를 넣어주어야 합니다. try { jsonData.put(“cookies”, cookiesJson); // 추가로 cookies 데이터를 셋팅, 가장 상위 depth에 cookies키가 존재하면 됩니다. } catch (Exception e) { e.printStackTrace(); } // “웹뷰에서 커스텀 뷰를 노출합니다.” // Webview 객체 구현 생략 // targetURL는 커스텀 뷰 호출에 사용되는 GCP 프로모션 서버와 약속된 프로토콜 url 입니다. webView.postUrl(targetURL, jsonData.toString().getBytes()); } }); } |
no return value |
in/out | Type | Name | Description |
---|---|---|---|
in | int | result |
Mercury callback |
// Android mercury callback 함수 예시 @Override public void mercuryCallBack(int result) { switch(result) { case Mercury.MERCURY_OPEN: { Toast.makeText(MainActivity.this, "MERCURY_OPEN", Toast.LENGTH_SHORT).show(); Log.d("Mercury", "MERCURY_OPEN"); break; } case Mercury.MERCURY_CLOSE: { Toast.makeText(MainActivity.this, "MERCURY_CLOSE", Toast.LENGTH_SHORT).show(); Log.d("Mercury", "MERCURY_CLOSE"); break; } case Mercury.MERCURY_FORCED_OPEN: { Toast.makeText(MainActivity.this, "MERCURY_FORCED_OPEN", Toast.LENGTH_SHORT).show(); Log.d("Mercury", "MERCURY_FORCED_OPEN"); break; } case Mercury.MERCURY_FORCED_CLOSE: { Toast.makeText(MainActivity.this, "MERCURY_FORCED_CLOSE", Toast.LENGTH_SHORT).show(); Log.d("Mercury", "MERCURY_FORCED_CLOSE"); break; } case Mercury.MERCURY_NETWORK_DISCONNECT: { mActivity.runOnUiThread(new Runnable() { @Override public void run() { AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); builder.setTitle("Network Disconnection"); builder.setMessage("Network was Disconnection."); builder.setCancelable(false); builder.setPositiveButton("OK", null); builder.create().show(); } }); break; } case Mercury.MERCURY_VIDEO_PROMOTION_START: { Toast.makeText(MainActivity.this, "MERCURY_START_PLAYBACK", Toast.LENGTH_SHORT).show(); Log.d("Mercury", "MERCURY_START_PLAYBACK"); // set game sound volume off break; } case Mercury.MERCURY_VIDEO_PROMOTION_FINISH: { Toast.makeText(MainActivity.this, "MERCURY_FINISH_PLAYBACK", Toast.LENGTH_SHORT).show(); Log.d("Mercury", "MERCURY_FINISH_PLAYBACK"); // set game sound volume on break; } default: break; } } |