drcrc28428 2016-12-07 05:27
浏览 46
已采纳

如何在SMSVerificationWithApplicationKey中传递特定于应用程序的自定义数据并在php后端检索它们?

I am IOS developer.

I am using SinchVerification for mobile verification in IOS application there is one security step. Pass custom data in sinchrequest after that sinch will call our server API (Verification Callback API) with server if he got valid response from our server then only it will send verification message this is for prevent misuse of our SMSVerificationApplicationKe.

Now I passed custom string but in PHP got following request so don't know how to get my passed string.

{"Host":"web.yourhost.test”,”Connection":"Keep-Alive","Accept-Encoding":"gzip","CF-IPCountry":"GB","X-Forwarded-For":"213.242.88.220","CF-RAY":"30cff02a4c2416d0-ARN","Content-Length":"816","X-Forwarded-Proto":"https","CF-Visitor":"{\"scheme\":\"https\"}","x-timestamp":"2016-12-06T13:03:28.2621119Z","Authorization":"application 737481a8-d133-4c71-9e9b-3a80656bbefd:p9rRHZZFutjmYOYDgBzWAYos6Mt4EXpUroUawSjOeBQ=","Content-Type":"application\/json; charset=utf-8","Cookie":"__cfduid=d5eaa6f6e99e7605ed74e0a40e50e50271481020280","CF-Connecting-IP":"213.242.88.220"}

And I am calling by,

  [SINVerification SMSVerificationWithApplicationKey:@"YOUR_KEY" phoneNumber:@"+919999999999" custom:@"stringTest"];
  • 写回答

1条回答 默认 最新

  • dougang7521 2016-12-07 19:22
    关注

    You need to read the body of the request that contains Json

    $data = json_decode(file_get_contents('php://input'), true);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?