SYOnlineSession Class Reference

#import <SYOnlineSession.h>

Inheritance diagram for SYOnlineSession:
Collaboration diagram for SYOnlineSession:

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) - authenticateWithSygicAccount:password:
 Authenticate with Sygic account. After successful authentication, Sygic server will consider the current user identity and the Sygic account as one user identity. More...
 
(void) - authenticateWithFacebookToken:
 Authenticate with Facebook token. Will let Sygic server know that the current user identity is connected to the Facebook account represented by the Facebook token. Sygic server will consider them as one user identity. More...
 
(void) - authenticateWithGoogleToken:
 Authenticate 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) - authenticateWithAppleToken:
 Authenticate 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) - authenticateWithAppleToken:name:email:
 Authenticate 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) - authenticateWithoutAccount
 Authenticate without account. Device code is used as a user identifier. More...
 
(void) - resetAuthentication
 Reset authentication. Sign out, forget an access token for the current user identity. After this, authentication will be required before any communication with Sygic servers. More...
 
(void) - refreshSession
 Refresh the active access token, if there is an active authentication. More...
 
(nonnull NSNumber *) - isAuthenticatedWithAccount
 Checks current authentication state. More...
 
(void) - getUserProfileWithCompletion:
 Request account information of the currently authenticated user. First call will retrieve data from server, all subsequent calls will reuse cached data. The cached data is cleared after resetAuthentication, new user authentication, and SDK deinitialization. More...
 

Class Methods

(nonnull SYOnlineSession *) + sharedSession
 Accesses the SYOnlineSession singleton object. More...
 
((unavailable("Use +[SYOnlineSession sharedSession] instead.") + __attribute__
 

Properties

id< SYOnlineSessionDelegatedelegate
 Current SYOnlineSession delegate. More...
 
BOOL onlineMapsEnabled
 Indicates whether Sygic SDK is allowed to access online maps services. More...
 
SYOnlineSessionStatus status
 Current connection status of SYOnlineSession. More...
 

Method Documentation

◆ sharedSession

+ (nonnull SYOnlineSession*) sharedSession

Accesses the SYOnlineSession singleton object.

◆ __attribute__ [1/2]

- ((unavailable("Use +[SYOnlineSession sharedSession] instead.") __attribute__

SYOnlineSession is singleton, use [SYOnlineSession sharedSession] to access singleton instance.

◆ __attribute__ [2/2]

+ ((unavailable("Use +[SYOnlineSession sharedSession] instead.") __attribute__

◆ setOnlineMapsDisabledWithCompletion:

- (nonnull SYTask*) setOnlineMapsDisabledWithCompletion: (nonnull void(^)(SYMapStreamingError *_Nullable error))  completion

◆ setOnlineMapsEnabledWithCompletion:

- (nonnull SYTask*) setOnlineMapsEnabledWithCompletion: (nonnull void(^)(SYMapStreamingError *_Nullable error))  completion

◆ authenticateWithSygicAccount:password:

- (void) authenticateWithSygicAccount: (nonnull NSString *)  username
password: (nonnull NSString *)  password 

Authenticate with Sygic account. After successful authentication, Sygic server will consider the current user identity and the Sygic account as one user identity.

Parameters
usernameuser name, usually it's an email
passwordSygic account password

◆ authenticateWithFacebookToken:

- (void) authenticateWithFacebookToken: (nonnull NSString *)  token

Authenticate with Facebook token. Will let Sygic server know that the current user identity is connected to the Facebook account represented by the Facebook token. Sygic server will consider them as one user identity.

Parameters
tokenFacebook token

◆ authenticateWithGoogleToken:

- (void) authenticateWithGoogleToken: (nonnull NSString *)  token

Authenticate 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.

Parameters
tokenGoogle token

◆ authenticateWithAppleToken:

- (void) authenticateWithAppleToken: (nonnull NSString *)  token

Authenticate 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.

Parameters
tokenApple token

◆ authenticateWithAppleToken:name:email:

- (void) authenticateWithAppleToken: (nonnull NSString *)  token
name: (nullable NSString *)  name
email: (nullable NSString *)  email 

Authenticate 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.

Parameters
tokenApple token
nameOptional user name. If the current user signs in for the first time, the value will be stored in the account.
emailOptional user e-mail. If the current user signs in for the first time, the value will be stored in the account.

◆ authenticateWithoutAccount

- (void) authenticateWithoutAccount

Authenticate without account. Device code is used as a user identifier.

◆ resetAuthentication

- (void) resetAuthentication

Reset authentication. Sign out, forget an access token for the current user identity. After this, authentication will be required before any communication with Sygic servers.

◆ refreshSession

- (void) refreshSession

Refresh the active access token, if there is an active authentication.

◆ isAuthenticatedWithAccount

- (nonnull NSNumber*) isAuthenticatedWithAccount

Checks current authentication state.

Returns
NSNumber(1), if authenticated with any account: Sygic, Facebook, Google, Apple, or other; NSNumber(0), if authenticated without account, or not authenticated at all.

◆ getUserProfileWithCompletion:

- (void) getUserProfileWithCompletion: (nonnull SYOnlineUserProfileCompletionBlock)  completion

Request account information of the currently authenticated user. First call will retrieve data from server, all subsequent calls will reuse cached data. The cached data is cleared after resetAuthentication, new user authentication, and SDK deinitialization.

Parameters
completionblock is called after the information is available. @discussion Result SYOnlineRequestResultIncorrectState means that the user is not authenticated, or authenticated without account.

Property Documentation

◆ delegate

- (id<SYOnlineSessionDelegate>) delegate
readwritenonatomicassign

Current SYOnlineSession delegate.

◆ onlineMapsEnabled

- (BOOL) onlineMapsEnabled
readnonatomicassign

Indicates whether Sygic SDK is allowed to access online maps services.

◆ status

- (SYOnlineSessionStatus) status
readnonatomicassign

Current connection status of SYOnlineSession.


The documentation for this class was generated from the following file: