Amazon sns (push notification) does not send to IOS application

前端 未结 3 1910
臣服心动
臣服心动 2021-01-13 17:43

Recently the app can not receive notification, the android side works fine but the ios one has fail

so here is what I have attempt:

1) generate token         


        
3条回答
  •  星月不相逢
    2021-01-13 18:32

    Make your Response as follow : if you're consuming from android use GCM or for ios use APNS_SANDBOX

    $sns = AWS::createClient('sns');
        $message = json_encode(['default' => '', 'APNS_SANDBOX' => json_encode($data), 'GCM' => json_encode(['data' => $data])]);
        $sns->publish([
            'TargetArn' => $arn,
            'Message' => $message,
            'MessageStructure' => 'json'
        ]);
    

提交回复
热议问题