Guten Tag, ich möchte automatisch eine SMS ohne Verwendung des Cordova SMS-Plugin Sned. Ich möchte den Bestätigungscode an alle Kunden senden, nachdem sie sich bei der App angemeldet haben. Gibt es einen möglichen Weg? Hoffe, du kannst mir helfen. Vielen Dank im Voraus. Ich verwende Ionic 2.Senden Sie SMS in Ionic 2 ohne Cordova Plugins
Antwort
Wenn Sie ein Backend ausführen, ist es ziemlich einfach. In diesem Beispiel wird der Knoten mit der Nexmo SMS API verwendet.
app.post('/', (req, res) => {
res.send(req.body);
const toNumber = req.body.number;
const text = req.body.text;
nexmo.message.sendSms(
NUMBER, toNumber, text, {type: 'unicode'},
(err, responseData) => {
if (err) {
console.log(err);
} else {
console.dir(responseData);
}
}
);
});
Siehe this article für ein vollständiges Beispiel.
Danke, aber wie kann ich es in Ionic 2 verwenden? – Patrick
@Patrick Führen Sie einen Node-Server mit diesem Code aus, und führen Sie einen Ajax-API-Aufruf (POST) für den Server aus, damit er die SMS sendet. Probieren Sie diese Artikel aus: [SMS senden] (https://scotch.io/tutorials/send-sms-from-the-browser-with-web-apis-node-and-nexmo), [async API-Aufrufe] (https: //medium.com/codingthesmartway-com-blog/getting-started-with-axios-166cb0035237) – janekkkk
- 1. Hinzufügen eines Cordova-Plugins zu Ionic 2
- 2. Ionic 2: Verwendung von Cordova Plugins
- 3. Ionic & Cordova SMS Plugin
- 4. So verwenden Sie nicht native Cordova Plugins in ionic 2
- 5. ionic 2 cordova, installiere cordova plugin typings
- 6. Wie Cordova Plugins in ionischen 2
- 7. Ionic 2 kein Zugriff auf/@ Typen/Cordova Plugins
- 8. Cordova Plugins funktionieren nicht mit Ionic
- 9. onSMSArrive cordova sms plugins mehr als einmal ausgeführt
- 10. Wie cordova mit Winkel 2 ohne Ionic zu verwenden
- 11. Ionic 2 Cordova Geolokalisierung Fehler
- 12. So senden Sie SMS, ohne die SMS-App zu öffnen
- 13. Senden von SMS mit Cordova-SMS-Plugin hängt
- 14. Unbenutzte Cordova Plugins entfernen
- 15. Verwendung von Cordova-Plugins in Ionic in einem Controller
- 16. Arbeiten mit nicht-ionischen nativen Plugins in Ionic 2
- 17. Importieren des Cordova-Plugins
- 18. Senden Sie SMS mit Variable mit Cordova Social-Share-Plugin
- 19. Onsen 2 - Monaca CLI - Cordova Plugins BarcodeScanner
- 20. Android: Telefon senden 2 SMS
- 21. Verwalten Sie Cordova Plugins mit Npm + Paket.json
- 22. Cordova Plugins in Ionic 1 App mit Typoskript
- 23. Erstellen eines Cordova-Plugins für Ionic basierend auf Android SDK
- 24. Ionic 2: benutze HtmlInfoWindow in nativen cordova-plugin-googlemaps
- 25. Holen Sie Cookie zurück von Cordova InAppBrowser in Ionic 2
- 26. Moment.js Plugins in Ionic2/Cordova typescript Projekt
- 27. Verwendung eines Cordova-Plugins von Drittanbietern in Ionic 2 mit TypeScript
- 28. Shop Bild Firebase Speicherung von cordova Kamera Plugins auf Ionic
- 29. Ionic 3 Google Maps Plugins
- 30. Senden Sie SMS mit C#
Gibt es eine Möglichkeit, Plugin ohne Öffnen der Messaging-App (automatisch senden Sie die SMS). – Patrick