Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Messaging for Dart is not including async/await #1514

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions src/routes/docs/products/messaging/apns/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -259,7 +259,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.updateApnsProvider(
Future result = await messaging.updateApnsProvider(
providerId: '[PROVIDER_ID]',
name: '[NAME]', // optional
enabled: false, // optional
Expand Down
6 changes: 3 additions & 3 deletions src/routes/docs/products/messaging/fcm/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -238,7 +238,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.updateFCMProvider(
Future result = await messaging.updateFCMProvider(
providerId: '[PROVIDER_ID]',
name: '[NAME]', // optional
enabled: false, // optional
Expand Down Expand Up @@ -327,4 +327,4 @@ let provider = try await messaging.updateFCMProvider(
{% /multicode %}
{% /tabsitem %}
{% /tabs %}
{% /section %}
{% /section %}
4 changes: 2 additions & 2 deletions src/routes/docs/products/messaging/mailgun/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -201,7 +201,7 @@ void main() { // Init SDK
.setKey('<API_KEY>') // Your secret API key
;

Future result = messaging.createEmail(
Future result = await messaging.createEmail(
messageId:'<MESSAGE_ID>' ,
subject:'<SUBJECT>' ,
content:'<CONTENT>' ,
Expand Down
6 changes: 3 additions & 3 deletions src/routes/docs/products/messaging/messages/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -429,7 +429,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.createPush(
Future result = await messaging.createPush(
messageId: '[MESSAGE_ID]',
title: '[TITLE]',
body: '[BODY]',
Expand Down Expand Up @@ -1133,4 +1133,4 @@ let message = try await messaging.createSms(

{% arrow_link href="/docs/products/messaging/send-sms-messages" %}
Learn more about sending a SMS message
{% /arrow_link %}
{% /arrow_link %}
6 changes: 3 additions & 3 deletions src/routes/docs/products/messaging/msg91/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -224,7 +224,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.createSms(
Future result = await messaging.createSms(
messageId: '[MESSAGE_ID]',
content: '[CONTENT]',
topics: [], // optional
Expand Down Expand Up @@ -591,4 +591,4 @@ let provider = try await messaging.updateMsg91Provider(
{% /multicode %}
{% /tabsitem %}
{% /tabs %}
{% /section %}
{% /section %}
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -406,7 +406,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.createTopic(
Future result = await messaging.createTopic(
topicId: '[TOPIC_ID]',
name: '[NAME]',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -670,7 +670,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.createPush(
Future result = await messaging.createPush(
messageId: '[MESSAGE_ID]',
title: '[TITLE]',
body: '[BODY]',
Expand Down
4 changes: 2 additions & 2 deletions src/routes/docs/products/messaging/sendgrid/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -194,7 +194,7 @@ void main() { // Init SDK
.setKey('<API_KEY>') // Your secret API key
;

Future result = messaging.createEmail(
Future result = await messaging.createEmail(
messageId:'<MESSAGE_ID>' ,
subject:'<SUBJECT>' ,
content:'<CONTENT>' ,
Expand Down
4 changes: 2 additions & 2 deletions src/routes/docs/products/messaging/smtp/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -203,7 +203,7 @@ void main() { // Init SDK
.setKey('<API_KEY>') // Your secret API key
;

Future result = messaging.createEmail(
Future result = await messaging.createEmail(
messageId:'<MESSAGE_ID>' ,
subject:'<SUBJECT>' ,
content:'<CONTENT>' ,
Expand Down
4 changes: 2 additions & 2 deletions src/routes/docs/products/messaging/telesign/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -223,7 +223,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.createSms(
Future result = await messaging.createSms(
messageId: '[MESSAGE_ID]',
content: '[CONTENT]',
topics: [], // optional
Expand Down
4 changes: 2 additions & 2 deletions src/routes/docs/products/messaging/textmagic/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -223,7 +223,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.createSms(
Future result = await messaging.createSms(
messageId: '[MESSAGE_ID]',
content: '[CONTENT]',
topics: [], // optional
Expand Down
6 changes: 3 additions & 3 deletions src/routes/docs/products/messaging/topics/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -180,7 +180,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.createTopic(
Future result = await messaging.createTopic(
topicId: '[TOPIC_ID]',
name: '[NAME]',
subscribe: '[ROLES]' // permission roles for who can subscribe
Expand Down Expand Up @@ -500,4 +500,4 @@ let subscriber = try await messaging.createSubscriber(
```
{% /multicode %}
{% /tabsitem %}
{% /tabs %}
{% /tabs %}
4 changes: 2 additions & 2 deletions src/routes/docs/products/messaging/twilio/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart';
import 'package:dart_appwrite/models.dart';

void main() { // Init SDK
void main() async { // Init SDK
Client client = Client();
Messaging messaging = Messaging(client);

Expand All @@ -225,7 +225,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = messaging.createSms(
Future result = await messaging.createSms(
messageId: '[MESSAGE_ID]',
content: '[CONTENT]',
topics: [], // optional
Expand Down
Loading