stitch-android-sdk

MongoDB Stitch Android SDK

APACHE-2.0 License

Stars
58
Committers
11

Bot releases are hidden (Show)

stitch-android-sdk - 4.7.0 Latest Release

Published by jsflax over 4 years ago

  • Fix bugs for customData
stitch-android-sdk - Release 4.5.0

Published by adamchel over 5 years ago

  • Adds support for additional options for watch in RemoteMongoCollection.
    • Watch for events on all documents.
    • Watch for all events matching a provided $match filter.
  • Fixes a bug where the remote MongoDB service for the server SDK had a dependency that had been deprecated and no longer published to gradle (see https://github.com/mongodb/stitch-android-sdk/issues/166).
stitch-android-sdk - Release 4.4.1

Published by adamchel over 5 years ago

  • Update Jackson dependency to fix security vulnerability.
stitch-android-sdk - Release 4.4.0

Published by adamchel over 5 years ago

NOTE: This release has breaking changes for the MongoDB Mobile Sync Beta

  • Mobile sync now uses compact change streams, which should save on network usage for collections with large documents and frequent updates that only affect a few fields.
    • When calling configure on a Sync, the ChangeEventListener will no longer guarantee that the ChangeEvent will have a non-null result for getFullDocument() if the OperationType is UPDATE.
    • When calling configure on a Sync, the signature for ConflictHandler#resolveConflict has changed:
      • It now returns a ConflictResolution. See the documentation for ConflictResolution for more information.
      • The type of the remote event in resolveConflict is now a CompactChangeEvent, to reflect the type of event received from the server. This means that when the remote event is an UPDATE, getFullDocument() will always return null.
  • It is now possible to add a listener/callback on the stream returned by RemoteMongoCollection#watch and RemoteMongoCollection#watchCompact.
stitch-android-sdk - Release 4.3.3

Published by adamchel over 5 years ago

  • Fixed a bug where an invalid session might not get refreshed, causing sync to freeze up and watch streams to fail to open.
stitch-android-sdk - Release 4.3.0

Published by dkaminsky over 5 years ago

  • Adds support for findOne, findOneAndReplace, findOneAndUpdate, findOneAndDelete operations
  • Adds recovery for network reconnect
  • Uses hashing to improve synchronization behavior
  • Automatically versions documents when remote and local are unversioned
  • Local reads now permitted while sync is in progress
  • Fixes various internal bugs and performance issues with the Mobile Sync Beta.
stitch-android-sdk - Release 4.2.1

Published by adamchel over 5 years ago

  • Fixes various internal bugs and performance issues with the Mobile Sync Beta.
    • NOTE: This release has breaking changes for the Mobile Sync Beta.
      • The methods configure, syncOne, syncMany, desyncOne, desyncMany, getSyncedIds, getPausedDocumentIds, and resumeSyncForDocument are now asynchronous and return a Task. This is to prevent accidentally freezing the UI on sync tasks.
      • Existing code that calls configure, syncOne, syncMany, desyncOne, and desyncMany does not need to change, since the they return Task<Void>. A completion listener can be added if you would like to react to configuration completing, or a document being configured as synced, but it is not necessary.
      • Existing code that calls getSyncedIds, getPausedDocumentIds, and resumeSyncForDocument must be called with a completion listener, or Tasks.await to use the result.
stitch-android-sdk - Release 4.2.0

Published by dkaminsky over 5 years ago

  • Adds multi-user support to the SDK
  • Adds the ability to watch remote collections
  • Miscellaneous behind-the-scenes improvements in sync behavior
stitch-android-sdk - Release 4.1.4

Published by edaniels almost 6 years ago

This release addresses some dependency vulnerabilities:

  • io.jsonwebtoken:jjwt:0.9.0 -> io.jsonwebtoken:jjwt:0.9.1
  • com.fasterxml.jackson.core:jackson-databind:2.9.5 -> com.fasterxml.jackson.core:jackson-databind:2.9.7
  • com.fasterxml.jackson.module:jackson-module-kotlin:2.9.5 -> com.fasterxml.jackson.module:jackson-module-kotlin:2.9.7
stitch-android-sdk - Release 4.1.3

Published by adamchel almost 6 years ago

  • Support for contacting applications deployed with a "local" deployment model
    • Before the first call to the client v2 API, the SDK now contacts the global MongoDB Stitch server to find out the deployment model and localized hostname for the application. The call is then redirected to the localized hostname (e.g. calls to Stitch for an app deployed locally to US-VA will hit a stitch server residing specifically in that location, while an app deployed globally will always use the global Stitch URL)
    • Subsequent calls to the API use the cached result
  • Fixed a bug in the sync beta code where a remote event with no version didn't conflict with a local document with no version.
  • Fixed a bug in the sync beta example app where stale local data would sometimes be improperly displayed in the UI.
stitch-android-sdk - Release 4.1.0

Published by edaniels almost 6 years ago

In this release we have released the beta of Stitch Mobile Sync! Documentation to follow shortly.

stitch-android-sdk - Release 4.0.5

Published by adamchel about 6 years ago

  • Added generic AWS service
    • New Packages:
      • org.mongodb:stitch-android-services-aws
      • org.mongodb:stitch-server-services-aws
  • Exposed StitchServiceClient to support services which are not well-defined by the SDK
stitch-android-sdk - Release 3.0.0

Published by jsflax over 6 years ago

Usage of StitchClient

StitchClient can longer be constructed directly. Instead, StitchClientFactory has been introduced to asynchronously perform any initialization steps needed to create a StitchClient. StitchClientFactory has a function called create that will return a Task that will resolve with a StitchClient after initialization. The resolved client should be used for the lifetime of the application.

Migration Path

// old, 2.x.x usage
import com.mongodb.stitch.android.StitchClient;

void init() {
    StitchClient stitchClient = StitchClient(appId: "<app-id>");
    stitchClient.logInWithProvider(new AnonymousAuthProvider())
        .addOnSuccessListener(new OnSuccessListener<String>() {
            @Override
            public void onSuccess(String userId) {
                Log.d("MyApp", userId);
            }
    });
}

// new, 3.x.x usage
import com.mongodb.stitch.android.StitchClientFactory;
StitchClient stitchClient = null;

void init() {
    StitchClientFactory.create(context, "<appId>")
        .continueWith(new Continuation<StitchClient, Task<String>>() {
            @Override
            public Task<String> then(@NonNull Task<StitchClient> task) throws Exception {
                stitchClient = task.getResult();
                return stitchClient.logInWithProvider(new AnonymousAuthProvider());
            }
        }).addOnSuccessListener(new OnSuccessListener<Task<String>>() {
            @Override
            public void onSuccess(Task<String> userIdTask) {
                initializeApp(stitchClient);
            }
        });
}

Since the StitchClient is only available after the Task resolves, initialization of an app should be deferred until this time and the client reference should be passed to some initialization component/function.

NOTE: Attempting to construct a StitchClient without using StitchClientFactory will result in an error being thrown.

Authentication

Previously, logging in with a provider while already logging caused no log in to happen which proved to be confusing. These new semantics are in effect:

  • Authenticating multiple times with anonymous authentication while already authenticated anonymously does nothing and returns the current user ID.
  • Authenticating with any provider but anonymous will log out the current user and then log in with the new provider.
  • Add isAuthenticated() method to the StitchClient class. This method should be used to check if any authentication work needs to happen. It returns a boolean declaring whether or not the current client is authenticated.