Skip to content

Commit 41ac57e

Browse files
committed
delete push example 2
1 parent f887771 commit 41ac57e

File tree

3 files changed

+31
-59
lines changed

3 files changed

+31
-59
lines changed

examples/PushExample.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
$spilt = ' - ';
1616

1717

18-
19-
2018
$master_secret = 'd94f733358cca97b18b2cb98';
2119
$app_key='47a3ddda34b2602fa9e17c01';
2220
JPushLog::setLogHandlers(array(new StreamHandler('jpush.log', Logger::DEBUG)));
@@ -52,6 +50,36 @@
5250

5351
echo $br . '-------------' . $br;
5452

53+
//easy push with ios badge +1
54+
try {
55+
$result = $client->push()
56+
->setPlatform(M\all)
57+
->setAudience(M\all)
58+
->setNotification(M\notification('Hi, JPush', M\ios("Hi, IOS", "happy", "+1")))
59+
->printJSON()
60+
->send();
61+
echo 'Push Success.' . $br;
62+
echo 'sendno : ' . $result->sendno . $br;
63+
echo 'msg_id : ' .$result->msg_id . $br;
64+
echo 'Response JSON : ' . $result->json . $br;
65+
} catch (APIRequestException $e) {
66+
echo 'Push Fail.' . $br;
67+
echo 'Http Code : ' . $e->httpCode . $br;
68+
echo 'code : ' . $e->code . $br;
69+
echo 'Error Message : ' . $e->message . $br;
70+
echo 'Response JSON : ' . $e->json . $br;
71+
echo 'rateLimitLimit : ' . $e->rateLimitLimit . $br;
72+
echo 'rateLimitRemaining : ' . $e->rateLimitRemaining . $br;
73+
echo 'rateLimitReset : ' . $e->rateLimitReset . $br;
74+
} catch (APIConnectionException $e) {
75+
echo 'Push Fail: ' . $br;
76+
echo 'Error Message: ' . $e->getMessage() . $br;
77+
//response timeout means your request has probably be received by JPUsh Server,please check that whether need to be pushed again.
78+
echo 'IsResponseTimeout: ' . $e->isResponseTimeout . $br;
79+
}
80+
81+
echo $br . '-------------' . $br;
82+
5583

5684
//full push
5785
try {

examples/PushExample2.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

examples/composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"require":{
3-
"jpush/jpush": "v3.2.0",
4-
"monolog/monolog":"*",
5-
"nategood/httpful":"*"
3+
"jpush/jpush": "v3.2.0"
64
}
75
}

0 commit comments

Comments
 (0)