Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 784 Bytes

File metadata and controls

28 lines (23 loc) · 784 Bytes
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
import io.appwrite.enums.OAuthProvider;

Client client = new Client(context)
    .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
    .setProject("<YOUR_PROJECT_ID>"); // Your project ID

Account account = new Account(client);

account.createOAuth2Session(
    OAuthProvider.AMAZON, // provider 
    "https://example.com", // success (optional)
    "https://example.com", // failure (optional)
    List.of(), // scopes (optional)
    new CoroutineCallback<>((result, error) -> {
        if (error != null) {
            error.printStackTrace();
            return;
        }

        Log.d("Appwrite", result.toString());
    })
);