Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
a5e4689b
Commit
a5e4689b
authored
Jul 18, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个推模板
parent
69d9487a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
9 deletions
+28
-9
GeTuiUtils.php
application/chat/utils/GeTuiUtils.php
+26
-7
RPush.php
application/chat/utils/RPush.php
+2
-2
No files found.
application/chat/utils/GeTuiUtils.php
View file @
a5e4689b
<?php
namespace
app\chat\utils
;
use
DictionaryAlertMsg
;
use
IGtAPNPayload
;
use
IGtTransmissionTemplate
;
/**
* Created by PhpStorm.
...
...
@@ -115,18 +118,34 @@ class GeTuiUtils
*/
function
onlineAllTemplate
(
$payload
,
$black_title
,
$content
)
{
$template
=
new
\IGtNotificat
ionTemplate
();
$template
=
new
IGtTransmiss
ionTemplate
();
$template
->
set_appId
(
$this
->
igt_app_id
);
//应用appid
$template
->
set_appkey
(
$this
->
igt_app_key
);
//应用appkey
$template
->
set_transmissionType
(
1
);
//透传消息类型
$template
->
set_transmissionContent
(
$payload
);
//透传内容
$template
->
set_title
(
$black_title
);
//通知栏标题
$template
->
set_text
(
$content
);
//通知栏内容
// $template->set_logo("http://wwww.igetui.com/logo.png");//通知栏logo
$template
->
set_isRing
(
true
);
//是否响铃
$template
->
set_isVibrate
(
true
);
//是否震动
$template
->
set_isClearable
(
true
);
//通知栏是否可清除
//$template->set_duration(BEGINTIME,ENDTIME); //设置ANDROID客户端在此时间区间内展示消息
// APN高级推送
$apn
=
new
IGtAPNPayload
();
$alertmsg
=
new
DictionaryAlertMsg
();
$alertmsg
->
body
=
$content
;
$alertmsg
->
actionLocKey
=
"ActionLockey"
;
$alertmsg
->
locKey
=
"LocKey"
;
$alertmsg
->
locArgs
=
array
(
"locargs"
);
$alertmsg
->
launchImage
=
"launchimage"
;
// iOS8.2 支持
$alertmsg
->
title
=
$black_title
;
$alertmsg
->
titleLocKey
=
"TitleLocKey"
;
$alertmsg
->
titleLocArgs
=
array
(
"TitleLocArg"
);
$apn
->
alertMsg
=
$alertmsg
;
$apn
->
badge
=
1
;
$apn
->
sound
=
""
;
$apn
->
add_customMsg
(
"payload"
,
"请填写内容"
);
// $apn->contentAvailable=1;
$apn
->
category
=
"ACTIONABLE"
;
$template
->
set_apnInfo
(
$apn
);
return
$template
;
}
...
...
application/chat/utils/RPush.php
View file @
a5e4689b
...
...
@@ -76,10 +76,10 @@ class RPush
$payload
=
json_encode
(
array
(
'title'
=>
$title
,
'content'
=>
$msg_content
,
'content'
=>
""
,
'type'
=>
'chat'
,
'url'
=>
''
,
'name'
=>
$title
,
'name'
=>
''
,
'imageUrl'
=>
''
,
'id'
=>
0
,
'ext'
=>
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment