Swift を使用して iOS アプリで plivo SMS API を使用するにはどうすればよいですか。これに関する多くのドキュメントを読みました。迅速に実装する方法がわかりません。
var plivo = require('plivo');
var p = plivo.RestAPI({
authId: 'Your AUTH_ID',
authToken: 'Your AUTH_TOKEN'
});
var params = {
'src': '1111111111', // Sender's phone number with country code
'dst' : '2222222222', // Receiver's phone Number with country code
'text' : "Hi, text from Plivo", // Your SMS Text Message - English
//'text' : "こんにちは、元気ですか?", // Your SMS Text Message - Japanese
//'text' : "Ce est texte généré aléatoirement", // Your SMS Text Message - French
'url' : "http://example.com/report/", // The URL to which with the status of the message is sent
'method' : "GET" // The method used to call the url
};
// Prints the complete response
p.send_message(params, function (status, response) {
console.log('Status: ', status);
console.log('API Response:\n', response);
console.log('Message UUID:\n', response['message_uuid']);
console.log('Api ID:\n', response['api_id']);
});
上記のコードは Node.js にあり、Swift で記述したいのですが、plivo を iOS アプリに統合する方法もわかりません。ユーザーが注文を要求するたびに管理者に SMS を送信するアプリを開発しています。したがって、Plivo から管理者への送信メッセージが必要です。どんな提案も本当に役に立ちます。