HereSDKManager
@interface HereSDKManager : NSObject
The class for configuring the Here Mobility SDK.
-
The shared HereSDKManager instance. The first time the sharedManager is required, it is initialized with credentials from the app’s Info.plist file. Make sure the Info.plist includes correct value for HereMobilitySDKAppId. If it missing, the SDK initialization fails, and the results are undefined.
Declaration
Objective-C
@property (readonly, nonatomic, nullable, class) HereSDKManager *sharedManager;Swift
class var shared: HereSDKManager? { get }Return Value
The shared HereSDKManager instance. nil if HereMobilitySDKAppId is missing.
-
Returns a HereSDKUserPreferences instance.
Holds user preferences, If not set the default is UserPrefereces with the
NSLocale.currentLocale.Declaration
Objective-C
@property (assign, readwrite, nonatomic) HereSDKUserPreferences *_Nonnull userPreferences;Swift
var userPreferences: HereSDKUserPreferences { get set } -
Returns a logging id. This id can be used to query Here Mobility SDK logs.
Declaration
Objective-C
@property (readonly, nonatomic) NSString *_Nonnull loggingId;Swift
var loggingId: String { get } -
Authenticate the application. You must call this before any network operation of the sdk (like demand, maps, etc.)
Declaration
Objective-C
- (void)authenticateApplication:(nonnull HereSDKApplicationAuthenticationInfo *) applicationAuthenticationInfo withHandler:(nonnull void (^)(NSError *_Nullable))handler;Swift
func authenticateApplication(_ applicationAuthenticationInfo: HereSDKApplicationAuthenticationInfo, withHandler handler: @escaping (Error?) -> Void)Parameters
applicationAuthenticationInfothe application authentication info
handlera handler that will be called to allow error handling
-
Requests SMS with verification code for given phone number. Calling this API will invalidate previous phone/email verification.
Declaration
Objective-C
- (void)sendVerificationSMS:(nonnull NSString *)phoneNumber withHandler:(nonnull void (^)(NSError *_Nullable))handler;Swift
func sendVerificationSMS(_ phoneNumber: String, withHandler handler: @escaping (Error?) -> Void)Parameters
phoneNumberThe user phone number.
handlerThe block to execute when action is completed.
-
- Requests email with verification code for given email.
Calling this API will invalidate previous phone/email verification.
Declaration
Objective-C
- (void)sendVerificationEmail:(nonnull NSString *)email withHandler:(nonnull void (^)(NSError *_Nullable))handler;Swift
func sendVerificationEmail(_ email: String, withHandler handler: @escaping (Error?) -> Void)Parameters
emailThe user phone number.
handlerThe block to execute when action is completed.
-
Verifies phone number with the given PIN code.
Declaration
Objective-C
- (void)verifyUserPhoneNumber:(nonnull NSString *)phoneNumber pinCode:(nonnull NSString *)pinCode withHandler:(nonnull void (^)(NSError *_Nullable))handler;Swift
func verifyUserPhoneNumber(_ phoneNumber: String, pinCode: String, withHandler handler: @escaping (Error?) -> Void)Parameters
phoneNumberThe user phone number
pinCodeThe pin code received via SMS.
handlerThe block to execute when action is completed.
-
Verifies email with the given PIN code.
Declaration
Objective-C
- (void)verifyUserEmail:(nonnull NSString *)email pinCode:(nonnull NSString *)pinCode withHandler:(nonnull void (^)(NSError *_Nullable))handler;Swift
func verifyUserEmail(_ email: String, pinCode: String, withHandler handler: @escaping (Error?) -> Void)Parameters
emailThe user email
pinCodeThe pin code received via Email.
handlerThe block to execute when action is completed.
-
Invalidates the verified tokens.
Declaration
Objective-C
- (void)userLogout;Swift
func userLogout() -
Returns a boolean value of user verification status.
Declaration
Objective-C
- (BOOL)isUserVerified;Swift
func isUserVerified() -> Bool -
Tells the SDK to begin a fetch operation, if it has data to download. To be called from application:performFetchWithCompletionHandler, if the application’s
background fetchmode is enabled.Declaration
Objective-C
- (void)performFetchWithCompletionHandler: (nonnull void (^)(UIBackgroundFetchResult))completionHandler;Swift
func performFetch(completionHandler: @escaping (UIBackgroundFetchResult) -> Void)Parameters
completionHandlerThe block to execute when the download operation is complete. This block is called with the fetch result value that describes the results of the SDK download operation.
-
Flushes SDK logs to the server
Declaration
Objective-C
- (void)forceLogsUpload:(void (^_Nullable)(BOOL))completion;Swift
func forceLogsUpload(_ completion: ((Bool) -> Void)? = nil)Parameters
completionOptional block to execute when the operation is complete. The block is called with
YESif succesful, orNOotherwise -
Configures the global that determines whether network calls can be made over a cellular connection. The default is
NO.Declaration
Objective-C
+ (void)allowCellularAccess:(BOOL)allow;Swift
class func allowCellularAccess(_ allow: Bool)Parameters
allowa boolean flag, Set to
YESto allow network calls should be allowed. Set toYESto allow network calls to be made over a cellular connection, or to ‘NO’ to prevent it. -
Configures the global log level setting, which determines the level of logs that are printed to the console.
Declaration
Objective-C
+ (void)configureLoggingLevel:(HereSDKLoggingLevel)loggingLevel;Swift
class func configureLoggingLevel(_ loggingLevel: HereSDKLoggingLevel)Parameters
loggingLevelThe level of logs that are printed to the console.
-
Configures the HereSDK and starts its services. This method should be called after the app is launched and before using HereSDK services.
Declaration
Objective-C
+ (void)configure;Swift
class func configure() -
Returns the SDK Version
Declaration
Objective-C
+ (nonnull NSString *)sdkVersion;Swift
class func sdkVersion() -> String
HereSDKManager Class Reference