#import <SYOnlineSession.h>
Instance Methods | |
((unavailable("Use +[SYOnlineSession sharedSession] instead.") | - __attribute__ |
SYOnlineSession is singleton, use [SYOnlineSession sharedSession] to access singleton instance. More... | |
(nonnull SYTask *) | - setOnlineMapsDisabledWithCompletion: |
(nonnull SYTask *) | - setOnlineMapsEnabledWithCompletion: |
(void) | - signInWithSygicAccount:password:completion: |
Sign in with Sygic account. After successful authentication, Sygic server will consider the current user identity and the provided Sygic account as one user identity. More... | |
(void) | - signInWithFacebookToken:completion: |
Sign in with Facebook token. Will let Sygic server know that the current user identity is connected to the provided Facebook account represented by the Facebook token. Sygic server will consider them as one user identity. More... | |
(void) | - signInWithGoogleToken:completion: |
Sign in with Google token. Will let Sygic server know that the current user identity is connected to the Google account represented by the Google token. Sygic server will consider them as one user identity. More... | |
(void) | - signInWithAppleToken:completion: |
Sign in with Apple token. Will let Sygic server know that the current user identity is connected to the Apple account represented by the Apple token. Sygic server will consider them as one user identity. More... | |
(void) | - signInWithAppleToken:name:email:completion: |
Sign in with Apple token. Will let Sygic server know that the current user identity is connected to the Apple account represented by the Apple token. Sygic server will consider them as one user identity. More... | |
(void) | - signOutWithCompletion: |
Sign out, stop using the currently authenticated user identity and forget the access token for it. More... | |
(void) | - requestAuthenticationRefresh |
Ask SYOnlineSession to refresh the access token for the currently authenticated user identity. This could be necessary for some online services to apply license changes (e.g. after purchase of some features). @discussion buildHeaders can be called immediately (or any time later) after requestAuthenticationRefresh, buildHeaders will complete the refresh and return headers based on the new token. More... | |
(void) | - notifyAuthenticationRejected |
Lets SYOnlineSession know, that one of Sygic services has rejected the authentication of the current user identity. More... | |
(void) | - getUserProfileWithCompletion: |
Request account information of the currently authenticated user. Will return error if not authenticated with account. First call will retrieve data from server, all subsequent calls will reuse cached data. The cached data is cleared after signIn, signOut, requestAuthenticationRefresh. More... | |
(void) | - buildHeadersWithCompletion: |
Prepare authentication headers to communicate with Sygic online services. Authentication headers are to be added to NSURLRequest which is sent to Sygic online services. This method is expected to be called for each request. More... | |
Class Methods | |
(nullable SYOnlineSession *) | + sharedSession |
SYOnlineSession singleton object. Returns nil if SYContext not initialized. More... | |
((unavailable("Use +[SYOnlineSession sharedSession] instead.") | + __attribute__ |
Properties | |
id< SYOnlineSessionDelegate > | delegate |
Current SYOnlineSession delegate. More... | |
SYOnlineSessionState | state |
Current authentication state. Signed out - authentication is not connected to an account, user identity is represented by device code. Signed in - authentication is connected to an account (Sygic, Google, Facebook, Apple, or other). More... | |
BOOL | onlineMapsEnabled |
Indicates whether Sygic SDK is allowed to access online maps services. More... | |
+ (nullable SYOnlineSession*) sharedSession |
SYOnlineSession singleton object. Returns nil if SYContext not initialized.
- ((unavailable("Use +[SYOnlineSession sharedSession] instead.") __attribute__ |
SYOnlineSession is singleton, use [SYOnlineSession sharedSession] to access singleton instance.
+ ((unavailable("Use +[SYOnlineSession sharedSession] instead.") __attribute__ |
- (nonnull SYTask*) setOnlineMapsDisabledWithCompletion: | (nonnull void(^)(SYMapStreamingError *_Nullable error)) | completion |
- (nonnull SYTask*) setOnlineMapsEnabledWithCompletion: | (nonnull void(^)(SYMapStreamingError *_Nullable error)) | completion |
- (void) signInWithSygicAccount: | (nonnull NSString *) | username | |
password: | (nonnull NSString *) | password | |
completion: | (nonnull SYOnlineSignInCompletionBlock) | completion | |
Sign in with Sygic account. After successful authentication, Sygic server will consider the current user identity and the provided Sygic account as one user identity.
username | user name, usually it's an email |
password | Sygic account password |
completion | called asynchronously on main queue when the operation is finished. |
- (void) signInWithFacebookToken: | (nonnull NSString *) | token | |
completion: | (nonnull SYOnlineSignInCompletionBlock) | completion | |
Sign in with Facebook token. Will let Sygic server know that the current user identity is connected to the provided Facebook account represented by the Facebook token. Sygic server will consider them as one user identity.
token | Facebook token |
completion | called asynchronously on main queue when the operation is finished. |
- (void) signInWithGoogleToken: | (nonnull NSString *) | token | |
completion: | (nonnull SYOnlineSignInCompletionBlock) | completion | |
Sign in with Google token. Will let Sygic server know that the current user identity is connected to the Google account represented by the Google token. Sygic server will consider them as one user identity.
token | Google token |
completion | called asynchronously on main queue when the operation is finished. |
- (void) signInWithAppleToken: | (nonnull NSString *) | token | |
completion: | (nonnull SYOnlineSignInCompletionBlock) | completion | |
Sign in with Apple token. Will let Sygic server know that the current user identity is connected to the Apple account represented by the Apple token. Sygic server will consider them as one user identity.
token | Apple token |
completion | called asynchronously on main queue when the operation is finished. |
- (void) signInWithAppleToken: | (nonnull NSString *) | token | |
name: | (nullable NSString *) | name | |
email: | (nullable NSString *) | ||
completion: | (nonnull SYOnlineSignInCompletionBlock) | completion | |
Sign in with Apple token. Will let Sygic server know that the current user identity is connected to the Apple account represented by the Apple token. Sygic server will consider them as one user identity.
token | Apple token |
name | Optional user name. If the current user signs in for the first time, the value will be stored in the account. |
Optional user e-mail. If the current user signs in for the first time, the value will be stored in the account. | |
completion | called asynchronously on main queue when the operation is finished. |
- (void) signOutWithCompletion: | (nonnull void(^)(void)) | completion |
Sign out, stop using the currently authenticated user identity and forget the access token for it.
completion | called asynchronously on main queue when the operation is finished. @discussion It's not necessary to wait until sign out is finished before calling other methods, all subsequent asynchronous calls can presume that the operation is already done. |
- (void) requestAuthenticationRefresh |
Ask SYOnlineSession to refresh the access token for the currently authenticated user identity. This could be necessary for some online services to apply license changes (e.g. after purchase of some features). @discussion buildHeaders can be called immediately (or any time later) after requestAuthenticationRefresh, buildHeaders will complete the refresh and return headers based on the new token.
- (void) notifyAuthenticationRejected |
Lets SYOnlineSession know, that one of Sygic services has rejected the authentication of the current user identity.
- (void) getUserProfileWithCompletion: | (nonnull SYOnlineUserProfileCompletionBlock) | completion |
Request account information of the currently authenticated user. Will return error if not authenticated with account. First call will retrieve data from server, all subsequent calls will reuse cached data. The cached data is cleared after signIn, signOut, requestAuthenticationRefresh.
completion | block is called asynchronously on main queue when the information is available. |
- (void) buildHeadersWithCompletion: | (nonnull SYOnlineBuildHeadersCompletionBlock) | completion |
Prepare authentication headers to communicate with Sygic online services. Authentication headers are to be added to NSURLRequest which is sent to Sygic online services. This method is expected to be called for each request.
completion | block is called asynchronously on main queue when headers are ready. @discussion Typically the headers are prepared quickly based on the cached access token, but if the token expired or doesn't exist (e.g. after signOut or requestAuthenticationRefresh), SYOnlineSession will make a network request to obtain the new access token and then call the completion. |
|
readwritenonatomicweak |
Current SYOnlineSession delegate.
|
readnonatomicassign |
Current authentication state. Signed out - authentication is not connected to an account, user identity is represented by device code. Signed in - authentication is connected to an account (Sygic, Google, Facebook, Apple, or other).
|
readnonatomicassign |
Indicates whether Sygic SDK is allowed to access online maps services.