Created
January 14, 2016 02:49
-
-
Save gimbimloki/a1b9ed3918e3cd16c9b2 to your computer and use it in GitHub Desktop.
Android SDK에서 토큰 등록시 필요한 옵션을 설정하는 코드.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Map<String, Object> createOptions() { | |
final Map<String, Object> options = new HashMap<String, Object>(); | |
options.put(PushSdk.KEY_ACTIVITY, YOUR_ACTIVITY); // Required. | |
options.put(PushSdk.KEY_SENDER_ID, YOUR_SENDER_ID); // Required. | |
options.put(PushSdk.KEY_SERVER_URL, "https://api-push.cloud.toast.com"); // Optional. Default: https://api-push.cloud.toast.com | |
options.put(PushSdk.KEY_CHANNEL, "default-channel"); // Optional. Default: ""(empty). | |
options.put(PushSdk.KEY_PUSH_TYPE, YOUR_PUSH_TYPE); // Optional. PushSdk.PUSH_TYPE_GCM or PushSdk.PUSH_TYPE_TENCENT. Default: PushSdk.PUSH_TYPE_GCM. | |
options.put(PushSdk.KEY_AGREE_NOTIFICATION, true); // Optional. Default: false. | |
options.put(PushSdk.KEY_AGREE_AD, true); // Optional. Default: false. | |
options.put(PushSdk.KEY_AGREE_NIGHT_AD, true); // Optional. Default: false. | |
options.put(PushSdk.KEY_COUNTRY, "KR"); // Optional. Default: "US". | |
options.put(PushSdk.KEY_LANGUAGE, "ko"); // Optional. Default: "en". | |
options.put(PushSdk.KEY_TIMEOUT, 30.0); // Optional. Time Unit: Second. Default: 30. | |
// Only TENCENT | |
if (PushSdk.PUSH_TYPE_TENCENT.equals(pushType)) { | |
options.put(PushSdk.KEY_ACCESS_ID, ACCESS_ID); // Required. | |
options.put(PushSdk.KEY_ACCESS_KEY, ACCESS_KEY); // Required. | |
} | |
return options; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment