-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from jpush/dev
merge version 3.2.8
- Loading branch information
Showing
13 changed files
with
417 additions
and
122 deletions.
There are no files selected for viewing
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
51 changes: 51 additions & 0 deletions
51
example/main/java/cn/jpush/api/examples/ClientExample.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package cn.jpush.api.examples; | ||
|
||
import cn.jpush.api.JPushClient; | ||
import cn.jpush.api.common.ClientConfig; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class ClientExample { | ||
protected static final Logger LOG = LoggerFactory.getLogger(ClientExample.class); | ||
|
||
private static final String appKey = "dd1066407b044738b6479275"; | ||
private static final String masterSecret = "e8cc9a76d5b7a580859bcfa7"; | ||
|
||
public static void main(String[] args) { | ||
// testDefaultClient(); | ||
// testCustomClient(); | ||
// testCustomPushClient(); | ||
} | ||
|
||
public static void testDefaultClient() { | ||
JPushClient client = new JPushClient(masterSecret, appKey); | ||
|
||
// JPushClient client1 = new JPushClient(masterSecret, appKey, null, ClientConfig.getInstance()); | ||
} | ||
|
||
public static void testCustomClient() { | ||
ClientConfig config = ClientConfig.getInstance(); | ||
config.setMaxRetryTimes(5); | ||
config.setConnectionTimeout(10 * 1000); // 10 seconds | ||
config.setSSLVersion("TLSv1.1"); // JPush server supports SSLv3, TLSv1, TLSv1.1, TLSv1.2 | ||
|
||
JPushClient jPushClient = new JPushClient(masterSecret, appKey, null, config); | ||
} | ||
|
||
public static void testCustomPushClient() { | ||
ClientConfig config = ClientConfig.getInstance(); | ||
|
||
config.setApnsProduction(false); // development env | ||
config.setTimeToLive(60 * 60 * 24); // one day | ||
|
||
// config.setGlobalPushSetting(false, 60 * 60 * 24); // development env, one day | ||
|
||
JPushClient jPushClient = new JPushClient(masterSecret, appKey, null, config); // JPush client | ||
|
||
// PushClient pushClient = new PushClient(masterSecret, appKey, null, config); // push client only | ||
|
||
} | ||
|
||
} | ||
|
||
|
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
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
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
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
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
Oops, something went wrong.