mirror of
https://github.com/easychen/pushdeer.git
synced 2025-01-10 15:05:27 +08:00
微调参数,支持随机notifyID
This commit is contained in:
parent
ea29e2314b
commit
e0b359f2a1
24
push/gorush-with-mipush/RoboFile.php
Normal file
24
push/gorush-with-mipush/RoboFile.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* This is project's console commands configuration for Robo task runner.
|
||||
*
|
||||
* @see http://robo.li/
|
||||
*/
|
||||
class RoboFile extends \Robo\Tasks
|
||||
{
|
||||
// define public methods as commands
|
||||
public function buildMac()
|
||||
{
|
||||
$this->_exec("cd src && go build -o ../bin/gorush.mac");
|
||||
}
|
||||
|
||||
public function testMac()
|
||||
{
|
||||
$this->_exec("bin/gorush.mac -c ../src/config/testdata/config.online.yml");
|
||||
}
|
||||
|
||||
public function buildLinux()
|
||||
{
|
||||
$this->_exec("cd src && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../bin/gorush");
|
||||
}
|
||||
}
|
Binary file not shown.
1
push/gorush-with-mipush/src/config/testdata/.gitignore
vendored
Normal file
1
push/gorush-with-mipush/src/config/testdata/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
config.online.yml
|
@ -12,6 +12,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"math/rand"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -80,9 +81,11 @@ func GetMINotification(req *PushNotification, pkg string) (*xmpush.Message, erro
|
||||
Title: payload.PushTitle,
|
||||
Description: payload.PushBody,
|
||||
PassThrough: int32(passThrough),
|
||||
NotifyType: 1,
|
||||
NotifyType: 3,
|
||||
NotifyID: rand.Int63n(1024),
|
||||
RestrictedPackageName: pkg,
|
||||
Extra: map[string]string{
|
||||
"notify_effect": "1",
|
||||
"notify_foreground": "1",
|
||||
"channel_id": "high_system",
|
||||
"channel_name": "服务提醒",
|
||||
|
Loading…
Reference in New Issue
Block a user