[ios] Update to libmbxaccounts 0.0.5 (#14683)
This commit is contained in:
@@ -50,7 +50,7 @@ static BOOL _MGLAccountsSDKEnabled;
|
||||
}
|
||||
|
||||
if (self.isAccountsSDKEnabled) {
|
||||
self.skuToken = MBXSKUToken.mapsToken;
|
||||
self.skuToken = [MBXSKUToken tokenForSKUID:MBXAccountsSKUIDMaps type:MBXAccountsSKUTypeUser];
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -131,7 +131,7 @@ static BOOL _MGLAccountsSDKEnabled;
|
||||
+ (NSString *)skuToken {
|
||||
if (MGLAccountManager.isAccountsSDKEnabled) {
|
||||
return [MGLAccountManager.sharedManager isSKUTokenExpired] ?
|
||||
MBXSKUToken.mapsToken :
|
||||
[MBXSKUToken tokenForSKUID:MBXAccountsSKUIDMaps type:MBXAccountsSKUTypeUser] :
|
||||
MGLAccountManager.sharedManager.skuToken;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -146,7 +146,7 @@ static NSString * const MGLVariableGeofence = @"VariableGeofence";
|
||||
}
|
||||
|
||||
if (MGLAccountManager.isAccountsSDKEnabled) {
|
||||
[[self sharedInstance] eventsManager].skuId = MBXAccountsMapsSKUIDMaps;
|
||||
[[self sharedInstance] eventsManager].skuId = MBXAccountsSKUIDMaps;
|
||||
}
|
||||
|
||||
[self flush];
|
||||
|
||||
@@ -2,13 +2,26 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSString *const MBXAccountsMapsSKUIDMaps;
|
||||
extern NSString *const MBXAccountsNavigationSKUIDMaps;
|
||||
typedef NSString *MBXAccountsSKUID NS_TYPED_ENUM;
|
||||
FOUNDATION_EXTERN const MBXAccountsSKUID MBXAccountsSKUIDMaps;
|
||||
FOUNDATION_EXTERN const MBXAccountsSKUID MBXAccountsSKUIDNavigation;
|
||||
|
||||
typedef NS_ENUM(NSInteger, MBXAccountsSKUType) {
|
||||
MBXAccountsSKUTypeUser,
|
||||
MBXAccountsSKUTypeSession
|
||||
};
|
||||
|
||||
@interface MBXSKUToken : NSObject
|
||||
|
||||
@property (class, nonatomic, readonly) NSString *mapsToken;
|
||||
@property (class, nonatomic, readonly) NSString *navigationToken;
|
||||
/**
|
||||
Generates a token for the given identifier and type.
|
||||
|
||||
@param skuId The sku identifier, e.g. maps or navigation.
|
||||
@param type The type of token, e.g. user or session.
|
||||
|
||||
@return A SKU token for use with API requests.
|
||||
*/
|
||||
+ (NSString *)tokenForSKUID:(MBXAccountsSKUID)skuId type:(MBXAccountsSKUType)type NS_SWIFT_NAME(token(for:type:));
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user