Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from appwrite/dev
Appwrite 1.2.0 support
- Loading branch information
Showing
210 changed files
with
3,704 additions
and
7,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,18 @@ | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
import io.appwrite.Client | ||
import io.appwrite.services.Account | ||
import io.appwrite.Client; | ||
import io.appwrite.coroutines.CoroutineCallback; | ||
import io.appwrite.services.Account; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
Client client = new Client(context) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
Account account = new Account(client); | ||
|
||
Client client = new Client(getApplicationContext()) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
|
||
Account account = new Account(client); | ||
|
||
account.createAnonymousSession(new Continuation<Object>() { | ||
@NotNull | ||
@Override | ||
public CoroutineContext getContext() { | ||
return EmptyCoroutineContext.INSTANCE; | ||
} | ||
|
||
@Override | ||
public void resumeWith(@NotNull Object o) { | ||
String json = ""; | ||
try { | ||
if (o instanceof Result.Failure) { | ||
Result.Failure failure = (Result.Failure) o; | ||
throw failure.exception; | ||
} else { | ||
Response response = (Response) o; | ||
json = response.body().string(); | ||
} | ||
} | ||
} catch (Throwable th) { | ||
Log.e("ERROR", th.toString()); | ||
} | ||
} | ||
}); | ||
account.createAnonymousSession(new CoroutineCallback<>((result, error) -> { | ||
if (error != null) | ||
error.printStackTrace(); | ||
return; | ||
} | ||
} | ||
|
||
Log.d("Appwrite", result.toString()); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,22 @@ | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
import io.appwrite.Client | ||
import io.appwrite.services.Account | ||
import io.appwrite.Client; | ||
import io.appwrite.coroutines.CoroutineCallback; | ||
import io.appwrite.services.Account; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
Client client = new Client(context) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
Account account = new Account(client); | ||
|
||
Client client = new Client(getApplicationContext()) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
account.createEmailSession( | ||
"email@example.com", | ||
"password" | ||
new CoroutineCallback<>((result, error) -> { | ||
if (error != null) { | ||
error.printStackTrace(); | ||
return; | ||
} | ||
|
||
Account account = new Account(client); | ||
|
||
account.createEmailSession( | ||
"email@example.com", | ||
"password" | ||
new Continuation<Object>() { | ||
@NotNull | ||
@Override | ||
public CoroutineContext getContext() { | ||
return EmptyCoroutineContext.INSTANCE; | ||
} | ||
|
||
@Override | ||
public void resumeWith(@NotNull Object o) { | ||
String json = ""; | ||
try { | ||
if (o instanceof Result.Failure) { | ||
Result.Failure failure = (Result.Failure) o; | ||
throw failure.exception; | ||
} else { | ||
Response response = (Response) o; | ||
json = response.body().string(); | ||
} | ||
} catch (Throwable th) { | ||
Log.e("ERROR", th.toString()); | ||
} | ||
} | ||
} | ||
); | ||
} | ||
} | ||
Log.d("Appwrite", result.toString()); | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,18 @@ | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
import io.appwrite.Client | ||
import io.appwrite.services.Account | ||
import io.appwrite.Client; | ||
import io.appwrite.coroutines.CoroutineCallback; | ||
import io.appwrite.services.Account; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
Client client = new Client(context) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
Account account = new Account(client); | ||
|
||
Client client = new Client(getApplicationContext()) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
|
||
Account account = new Account(client); | ||
|
||
account.createJWT(new Continuation<Object>() { | ||
@NotNull | ||
@Override | ||
public CoroutineContext getContext() { | ||
return EmptyCoroutineContext.INSTANCE; | ||
} | ||
|
||
@Override | ||
public void resumeWith(@NotNull Object o) { | ||
String json = ""; | ||
try { | ||
if (o instanceof Result.Failure) { | ||
Result.Failure failure = (Result.Failure) o; | ||
throw failure.exception; | ||
} else { | ||
Response response = (Response) o; | ||
json = response.body().string(); | ||
} | ||
} | ||
} catch (Throwable th) { | ||
Log.e("ERROR", th.toString()); | ||
} | ||
} | ||
}); | ||
account.createJWT(new CoroutineCallback<>((result, error) -> { | ||
if (error != null) | ||
error.printStackTrace(); | ||
return; | ||
} | ||
} | ||
|
||
Log.d("Appwrite", result.toString()); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,22 @@ | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
import io.appwrite.Client | ||
import io.appwrite.services.Account | ||
import io.appwrite.Client; | ||
import io.appwrite.coroutines.CoroutineCallback; | ||
import io.appwrite.services.Account; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
Client client = new Client(context) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
Account account = new Account(client); | ||
|
||
Client client = new Client(getApplicationContext()) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
account.createMagicURLSession( | ||
"[USER_ID]", | ||
"email@example.com", | ||
new CoroutineCallback<>((result, error) -> { | ||
if (error != null) { | ||
error.printStackTrace(); | ||
return; | ||
} | ||
|
||
Account account = new Account(client); | ||
|
||
account.createMagicURLSession( | ||
"[USER_ID]", | ||
"email@example.com", | ||
new Continuation<Object>() { | ||
@NotNull | ||
@Override | ||
public CoroutineContext getContext() { | ||
return EmptyCoroutineContext.INSTANCE; | ||
} | ||
|
||
@Override | ||
public void resumeWith(@NotNull Object o) { | ||
String json = ""; | ||
try { | ||
if (o instanceof Result.Failure) { | ||
Result.Failure failure = (Result.Failure) o; | ||
throw failure.exception; | ||
} else { | ||
Response response = (Response) o; | ||
json = response.body().string(); | ||
} | ||
} catch (Throwable th) { | ||
Log.e("ERROR", th.toString()); | ||
} | ||
} | ||
} | ||
); | ||
} | ||
} | ||
Log.d("Appwrite", result.toString()); | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,21 @@ | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
import io.appwrite.Client | ||
import io.appwrite.services.Account | ||
import io.appwrite.Client; | ||
import io.appwrite.coroutines.CoroutineCallback; | ||
import io.appwrite.services.Account; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
Client client = new Client(context) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
Account account = new Account(client); | ||
|
||
Client client = new Client(getApplicationContext()) | ||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | ||
.setProject("5df5acd0d48c2"); // Your project ID | ||
account.createOAuth2Session( | ||
"amazon", | ||
new CoroutineCallback<>((result, error) -> { | ||
if (error != null) { | ||
error.printStackTrace(); | ||
return; | ||
} | ||
|
||
Account account = new Account(client); | ||
|
||
account.createOAuth2Session( | ||
this, | ||
"amazon", | ||
new Continuation<Object>() { | ||
@NotNull | ||
@Override | ||
public CoroutineContext getContext() { | ||
return EmptyCoroutineContext.INSTANCE; | ||
} | ||
|
||
@Override | ||
public void resumeWith(@NotNull Object o) { | ||
String json = ""; | ||
try { | ||
if (o instanceof Result.Failure) { | ||
Result.Failure failure = (Result.Failure) o; | ||
throw failure.exception; | ||
} | ||
} catch (Throwable th) { | ||
Log.e("ERROR", th.toString()); | ||
} | ||
} | ||
} | ||
); | ||
} | ||
} | ||
Log.d("Appwrite", result.toString()); | ||
}) | ||
); |
Oops, something went wrong.