-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Helperhaps
committed
Jul 19, 2017
1 parent
f5ff233
commit d434123
Showing
5 changed files
with
31 additions
and
4 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
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,24 @@ | ||
from . import jpush | ||
from jpush import common | ||
|
||
group_key = u'xxxxxx' | ||
group_secret = u'xxxxxx' | ||
|
||
group = jpush.GroupPush(group_key, group_secret) | ||
group.set_logging("DEBUG") | ||
|
||
def all(): | ||
push = group.create_push() | ||
push.audience = jpush.all_ | ||
push.notification = jpush.notification(alert="!hello python jpush api") | ||
push.platform = jpush.all_ | ||
try: | ||
response=push.send() | ||
except common.Unauthorized: | ||
raise common.Unauthorized("Unauthorized") | ||
except common.APIConnectionException: | ||
raise common.APIConnectionException("conn") | ||
except common.JPushFailure: | ||
print ("JPushFailure") | ||
except: | ||
print ("Exception") |
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