diff --git a/push/gorush-with-mipush/RoboFile.php b/push/gorush-with-mipush/RoboFile.php new file mode 100644 index 0000000..babcda9 --- /dev/null +++ b/push/gorush-with-mipush/RoboFile.php @@ -0,0 +1,24 @@ +_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"); + } +} diff --git a/push/gorush-with-mipush/bin/gorush b/push/gorush-with-mipush/bin/gorush index dfa5680..5a43c81 100755 Binary files a/push/gorush-with-mipush/bin/gorush and b/push/gorush-with-mipush/bin/gorush differ diff --git a/push/gorush-with-mipush/src/config/testdata/.gitignore b/push/gorush-with-mipush/src/config/testdata/.gitignore new file mode 100644 index 0000000..0bfb4ba --- /dev/null +++ b/push/gorush-with-mipush/src/config/testdata/.gitignore @@ -0,0 +1 @@ +config.online.yml diff --git a/push/gorush-with-mipush/src/notify/notification_mipush.go b/push/gorush-with-mipush/src/notify/notification_mipush.go index e07e051..7108655 100644 --- a/push/gorush-with-mipush/src/notify/notification_mipush.go +++ b/push/gorush-with-mipush/src/notify/notification_mipush.go @@ -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": "服务提醒",