2016-11-09, 9)34 AM
Flybits SDK v3.0 V 3.2 Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1) Added: '@discardableResult' to some of the functions, so Xcode doesn't complain for unused return value Fixed: Push - When a moment modified push is received and autoFetch is enabled, it downloads both Zone & Moment object, but it used to not return that to the app Fixed: PushManager forwards all the push entity-types to the app; Fixed: Pedometer steps count sometimes doesn't call completion; Changed: Push - When posting notification on NotificationCenter, object used to be nil, now it's set to PushManager.sharedManager, so you can listen for all the notification that relates to push by setting the object as PushManager.sharedManager Changed: Calling subscribeToPush on Moment used to only register limited set of push, now it registers for more push messages so Moment's name, icon, metadata changes can be listened.
V 3.1.1 Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1) Swift version 3.0.1 support Resolved Push connection issue
V 3.1 Fixed: Setting PushManager.sharedManager.apnsToken used to not upload the proper token Added: All the callback with 'Error' returns 'flybitssdk_details' (if the error contains more details) Changed: - Old: func setupLogging(_ level: Int, colors: Bool = false) New: func setupLogging(_ level: Int, options:[String: Any]? = nil) - Old: init? (response: HTTPURLResponse, representation: AnyObject) New: init?(response: HTTPURLResponse, representation: AnyObject) throws - Old: FlybitsRequest.httpSuccessStatusCode: CountableRange? = 200 ..< 300 New: FlybitsRequest.httpSuccessStatusCode: Range? = Range(200.. Void)? = nil) -> Bool New: public func received(_ notification: [String : AnyObject], fetchCompletionHandler completionHandler: ((UIBackgroundFetchResult) -> Void)? = nil) -> Bool Old: public func subscribeToNotification(_ notificationType: NotificationType, instance: T) subscribe(to instance: T) Old: public func subscribeToTopic(_ topic: String) New: public func subscribe(to topic: String) Old: ic func unsubscribeFromNotification(_ notificationType: NotificationType, instance: T) unsubscribe(from instance: T) Old: public func unsubscribeFromTopic(_ topic: String) New: public func unsubscribe(from topic: String)
New: public func New: public func
PushConfigurable Old: id New: identifier
PushConfiguration Old: public static func configurationWithServiceLevel(_ serviceLevel: PushServiceLevel = .none) -> PushConfiguration New: public static func configuration(with serviceLevel: PushServiceLevel = .none) -> PushConfiguration Old: public static func configurationWithServiceLevel(_ serviceLevel: PushServiceLevel = .none, andAPNSToken apnsToken: Data) -> PushConfiguration New: blic static func configuration(with serviceLevel: PushServiceLevel = .none, apnsToken: Data) -> PushConfiguration Old: public static func configurationWithServiceLevel(_ serviceLevel: PushServiceLevel = .none, apnsToken: Data, andDeviceRegistrationData deviceRegistrationData: [String : AnyObject]) -> PushConfiguration New: public static func configuration(with serviceLevel: PushServiceLevel = .none, apnsToken: Data, deviceRegistrationData: [String : AnyObject]) -> PushConfiguration Old: public static func configurationWithServiceLevel(_ serviceLevel: PushServiceLevel = .none, apnsToken: Data, andAutoFetchData autoFetchData: Bool) -> PushConfiguration New: public static func configuration(with serviceLevel: PushServiceLevel = .none, apnsToken: Data, autoFetchData: Bool) -> PushConfiguration Old: public static func configurationWithServiceLevel(_ serviceLevel: PushServiceLevel = .none, apnsToken: Data, autoFetchData: Bool, andAutoReconnect autoReconnect: Bool) -> PushConfiguration New: public static func configuration(with serviceLevel: PushServiceLevel = .none, apnsToken: Data, autoFetchData: Bool, autoReconnect: Bool) -> PushConfiguration Old: public static func configurationWithServiceLevel(_ serviceLevel: PushServiceLevel = .none, apnsToken: Data, autoFetchData: Bool, autoReconnect: Bool, andDeviceRegistrationData deviceRegistrationData: [String : AnyObject]) -> PushConfiguration New: public static func configuration(with serviceLevel: PushServiceLevel = .none, apnsToken: Data, autoFetchData: Bool, autoReconnect: Bool, deviceRegistrationData: [String : AnyObject]) -> PushConfiguration Old: public func updateTokenOnServer(_ token: Data, deviceRegistrationData: [String : AnyObject]? = nil, withCompletion completion: ((NSError?) -> Void)? = nil) New: public func updateOnServer(_ token: Data, deviceRegistrationData: [String : AnyObject]? = nil, completion: ((NSError?) -> Void)? = nil)
ZoneRequest Old: ZoneRequest.Create((zone: FlybitsSDK.Zone, completion: (zone: FlybitsSDK.Zone?, error: NSError?) -> Void)) New: ZoneRequest.create(zone: FlybitsSDK.Zone, completion: (_ zone: FlybitsSDK.Zone?, _ error: NSError?) -> Void)
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 2 of 19
2016-11-09, 9)34 AM
Old: ZoneRequest.Query((ZonesQuery, completion: (zones: [FlybitsSDK.Zone], pagination: Pager?, error: NSError?) -> Void)) New: ZoneRequest.query(ZonesQuery, completion: (_ zones: [FlybitsSDK.Zone], _ pagination: Pager?, _ error: NSError?) - Void) Old: ZoneRequest.GetZone((id: String, completion: (zone: FlybitsSDK.Zone?, error: NSError?) -> Void)) New: ZoneRequest.getZone(identifier: String, completion: (_ zone: FlybitsSDK.Zone?, _ error: NSError?) -> Void) Old: ZoneRequest.Update((zone: FlybitsSDK.Zone, completion: (zone: FlybitsSDK.Zone?, error: NSError?) -> Void)) New: ZoneRequest.update(zone: FlybitsSDK.Zone, completion: (_ zone: FlybitsSDK.Zone?, _ error: NSError?) -> Void) Old: ZoneRequest.Delete((id: String, completion: (error: NSError?) -> Void)) New: ZoneRequest.delete(identifier: String, completion: (_ error: NSError?) -> Void) Old: ZoneRequest.Publish((zone: FlybitsSDK.Zone, completion: (zone: FlybitsSDK.Zone?, error: NSError?) -> Void)) New: ZoneRequest.publish(zone: FlybitsSDK.Zone, completion: (_ zone: FlybitsSDK.Zone?, _ error: NSError?) -> Void) Old: ZoneRequest.Unpublish((zone: FlybitsSDK.Zone, completion: (zone: FlybitsSDK.Zone?, error: NSError?) -> Void)) New: ZoneRequest.unpublish(zone: FlybitsSDK.Zone, completion: (_ zone: FlybitsSDK.Zone?, _ error: NSError?) -> Void) Old: ZoneRequest.Favourite((zoneID: String, favourite: Bool, completion: (zoneID: String, success: Bool, error: NSError?) -> Void)) New: ZoneRequest.favourite(identifier: String, favourite: Bool, completion: (_ identifier: String, _ success Bool, _ error: NSError?) -> Void)
UserRequest Old: UserRequest.GetSelf(completion: (user: User?, error: NSError?) -> Void) New: UserRequest.getSelf(completion: (_ user: User?, _ error: NSError?) -> Void) Old: UserRequest.GetUser(userID:String, completion: (user: User?, error: NSError?) -> Void) New: UserRequest.getUser(userID:String, completion: (_ user: User?, _ error: NSError?) -> Void) Old: UserRequest.GetUsers(UsersQuery, completion: (users: [User], pager: Pager?, error: NSError?) -> Void) New: UserRequest.getUsers(UsersQuery, completion: (_ users: [User], _ pager: Pager?, _ error: NSError?) -> Void) Old: UserRequest.RefreshJWT(completion: (error: NSError?) -> Void) New: UserRequest.refreshJWT(completion: (_ error: NSError?) -> Void) Old: UserRequest.Disable(completetion: (error: NSError?) -> Void) New: UserRequest.disable(completetion: (_ error: NSError?) -> Void) Old: UserRequest.RememberMe(completion: (error: NSError?) -> Void) New: UserRequest.rememberMe(completion: (_ error: NSError?) -> Void)
AccountRequest public enum AccountRequest: Requestable { - Old: AccountRequest.Register(AccountQuery, completion: (user: User?, error: NSError?) -> Void) New: AccountRequest.register(AccountQuery, completion: (_ user: User?, _ error: NSError?) -> Void) - Old: AccountRequest.UpdateDetails(completion: (user: User?, error: NSError?) -> Void) New: AccountRequest.updateDetails(completion: (_ user: User?, _ error: NSError?) -> Void) - Old: AccountRequest.UpdateProfile(userID:String, profile: UserProfile, completion:(profile:UserProfile?, error: NSError?) -> Void) New: AccountRequest.updateProfile(userID:String, profile: UserProfile, completion:(_ profile:UserProfile?, _ error: NSError?) -> Void) - Old: AccountRequest.UpdateEmail(newEmail: String, password: String, completion: (user: User?, error: NSError?) -> Void) New: AccountRequest.updateEmail(newEmail: String, password: String, completion: (_ user: User?, _ error: NSError?) -> Void) - Old: AccountRequest.UpdateImageWithFile(newImage: UploadImageItem, completion: (user: User?, error: NSError?) -> Void) New: AccountRequest.updateImageWithFile(newImage: UploadImageItem, completion: (_ user: User?, _ error: NSError?) -> Void) - Old: AccountRequest.UpdateImageWithImage(image: UIImage, completion: (user: User?, error: NSError?) -> Void) New: AccountRequest.updateImageWithImage(image: UIImage, completion: (_ user: User?, _ error: NSError?) -> Void) - Old: AccountRequest.UpdateImageWithURL(newImageURL: String, completion: (user: User?, error: NSError?) -> Void) New: AccountRequest.updateImageWithURL(newImageURL: String, completion: (_ user: User?, _ error: NSError?) -> Void) - Old: AccountRequest.UpdatePassword(oldPassword: String, newPassword: String, completion: (error: NSError?) -> Void) New: AccountRequest.updatePassword(from: String, to: String, completion: (_ error: NSError?) -> Void) - Old: AccountRequest.ForgotPassword(email:String, completion: (error: NSError?) -> Void) New: AccountRequest.forgotPassword(email:String, completion: (_ error: NSError?) -> Void)
SessionRequest Old: SessionRequest.Login(email: String, password: String, rememberMe: Bool, completion: (user: User?, error: NSError?) -> Void) New: SessionRequest.login(email: String, password: String, rememberMe: Bool, fetchJWT: Bool, completion: (_ user: User?, _ error: NSError?) -> Void) Old: SessionRequest.TokenLogin(String, isOAuthToken: Bool, rememberMe: Bool, completion: (user: User?, error: NSError?) -> Void) New: SessionRequest.tokenLogin(String, isOAuthToken: Bool, rememberMe: Bool, fetchJWT: Bool, completion: (_ user: User?, _ error: NSError?) -> Void) Old: SessionRequest.SyntheticLogin(provider: String, token: String, signature: NSData, completion: (user: User?, error: NSError?) -> Void) New: SessionRequest.syntheticLogin(provider: String, token: String, signature: Data, rememberMe: Bool, fetchJWT: Bool, completion: (_ user: User?, _ error: NSError?) -> Void) Old: SessionRequest.Logout(completion: (success: Bool, error: NSError?) -> Void) New: SessionRequest.logout(completion: (_ success: Bool, _ error: NSError?) -> Void)
TagsRequest Old: TagsRequest.Query(TagQuery, completion:(tags: [T]?, pagination: Pager?, error: NSError?) -> Void) New: TagsRequest.query(TagQuery, completion:(_ tags: [T]?, _ pagination: Pager?, _ error: NSError?) -> Void) Old: TagsRequest.GetTag(id: String, completion:(tag: T?, error: NSError?) -> Void) _ error: NSError?) -> Void)
New: TagsRequest.getTag(id: String, completion:(_ tag: T?,
MomentRequest Old: MomentRequest.query(MomentQuery, completion: (moments: [Moment], pagination: Pager?, error: NSError?) -> Void) New: MomentRequest.query(MomentQuery, completion: (_ moments: [Moment], _ pagination: Pager?, _ error: NSError?) -> Void) Old: MomentRequest.getZoneMoments(zoneID: String, completion: (moments: [Moment], pagination: Pager?, error: NSError?) -> Void) New: MomentRequest.getZoneMoments(zoneID: String, completion: (_ moments: [Moment], _ pagination: Pager?, _ error: NSError?) -> Void) Old: MomentRequest.getMoment(identifier: String, completion: (moment: Moment?, error: NSError?) -> Void) New:
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 3 of 19
2016-11-09, 9)34 AM
MomentRequest.getMoment(identifier: String, completion: (_ moment: Moment?, _ error: NSError?) -> Void) Old: MomentRequest.getMoments(type: String, completion: (moments: [Moment], error: NSError?) -> Void) New: MomentRequest.getMoments(type: String, completion: (_ moments: [Moment], _ error: NSError?) -> Void) Old: MomentRequest.authorize(moment: Moment, completion: (authorization: MomentAuthorizationResponse?, error: NSError?) -> Void) New: MomentRequest.authorize(moment: Moment, completion: (_ authorization: MomentAuthorizationResponse?, _ error: NSError?) -> Void) Old: MomentRequest.validate(moment: Moment, authorization: MomentAuthorizationResponse, completion: (validated: Bool, error: NSError?) -> Void) New: MomentRequest.validate(moment: Moment, authorization: MomentAuthorizationResponse, completion: (_ validated: Bool, _ error: NSError?) -> Void) Old: MomentRequest.autoValidate(moment: Moment, completion: (validated: Bool, error: NSError?) -> Void) New: MomentRequest.autoValidate(moment: Moment, completion: (_ validated: Bool, _ error: NSError?) -> Void)
RuleRequest Old: RuleRequest.GetRule(ruleID: String, completion: (rule: Rule?, NSError?) -> Void) New: RuleRequest.getRule(ruleID: String, completion: (_ rule: Rule?, NSError?) -> Void) Old: RuleRequest.GetRules(completion: (rules: [Rule]?, NSError?) -> Void) -> Void)
New: RuleRequest.getRules(completion: (_ rules: [Rule]?, NSError?)
ContextDataRequest Old: ContextDataRequest.SendData([[String : AnyObject]], completion: (NSError?) -> Void) New: ContextDataRequest.sendData([[String : AnyObject]], completion: (NSError?) -> Void)
DeviceRequest Old: DeviceRequest.connect(DeviceQuery, completion: (NSError?) -> Void) New: DeviceRequest.connect(DeviceQuery, completion: (NSError?) -> Void) Old: DeviceRequest.disconnect(DeviceQuery, completion: (NSError?) -> Void) New: DeviceRequest.disconnect(DeviceQuery, completion: (NSError?) -> Void) Old: DeviceRequest.registerDevice(completion: (Device?, NSError?) -> Void) New: DeviceRequest.registerDevice(completion: (Device?, NSError?) -> Void) Old: DeviceRequest.registerToken(token: String, deviceRegistrationData: [String : AnyObject]?, completion: (NSError?) -> Void) New: DeviceRequest.registerToken(token: String, deviceRegistrationData: [String : AnyObject]?, completion: (NSError?) -> Void) Old: DeviceRequest.removeToken(token: String, completion: (NSError?) -> Void) New: DeviceRequest.removeToken(token: String, completion: (NSError?) -> Void)
PushRequest -Old: PushRequest.NotificationHistory(query: PushQuery, completion: (messages: [PushMessage], pager: Pager?, error: NSError?) -> Void) New: PushRequest.notificationHistory(query: PushQuery, completion: (_ messages: [PushMessage], _ pager: Pager?, _ error: NSError?) -> Void)
PushPreferenceRequest Old: PushPreferenceRequest.Retrieve(completion: (preferences: APNSPreferences?, error: NSError?) -> Void) New: PushPreferenceRequest.retrieve(completion: (_ preferences: APNSPreferences?, _ error: NSError?) -> Void) Old: PushPreferenceRequest.Update(APNSPreferences, completion: (error: NSError?) -> Void) New: PushPreferenceRequest.update(APNSPreferences, completion: (_ error: NSError?) -> Void)
ImageRequest Old: ImageRequest.DownloadRaw100(Image, completion: (rawData: NSData?, error: NSError?) -> Void) New: ImageRequest.downloadRaw100(Image, completion: (_ rawData: Data?, _ error: NSError?) -> Void) Old: ImageRequest.DownloadRaw100ForLocale(Image, NSLocale?, completion: (rawData: NSData?, error: NSError?) -> Void) New: ImageRequest.downloadRaw100ForLocale(Image, Locale?, completion: (_ rawData: Data?, _ error: NSError?) -> Void) Old: ImageRequest.DownloadRaw(Image, NSLocale?, ImageSize, completion: (rawData: NSData?, error: NSError?) -> Void) New: ImageRequest.downloadRaw(Image, Locale?, ImageSize, completion: (_ rawData: Data?, _ error: NSError?) -> Void) Old: ImageRequest.Download100(Image, completion: (image: UIImage?, error: NSError?) -> Void) New: ImageRequest.download100(Image, completion: (_ image: UIImage?, _ error: NSError?) -> Void) Old: ImageRequest.Download100ForLocale(Image, NSLocale?, completion: (image: UIImage?, error: NSError?) -> Void) New: ImageRequest.download100ForLocale(Image, Locale?, completion: (_ image: UIImage?, _ error: NSError?) -> Void) Old: ImageRequest.Download(Image, NSLocale?, ImageSize, completion: (image: UIImage?, error: NSError?) -> Void) New: ImageRequest.download(Image, Locale?, ImageSize, completion: (_ image: UIImage?, _ error: NSError?) -> Void) Old: ImageRequest.FlybitsFileUpload(UploadImageItem, completion: (result: ImageMetadata?, NSError?) -> Void) New: ImageRequest.flybitsFileUpload(UploadImageItem, completion: (_ result: ImageMetadata?, NSError?) -> Void) Old: ImageRequest.FlybitsURLUpload(String, completion: (result: ImageMetadata?, NSError?) -> Void) New: ImageRequest.flybitsURLUpload(String, completion: (_ result: ImageMetadata?, NSError?) -> Void) Old: ImageRequest.Upload(UploadImageItem, completion: (result: AnyObject?, NSError?) -> Void) New: ImageRequest.upload(UploadImageItem, completion: (_ result: AnyObject?, NSError?) -> Void)
SettingsRequest Old: SettingsRequest.GetTenantSetting(completion:(setting:[NSObject:AnyObject]?, error:NSError?) -> Void) New: SettingsRequest.getTenantSetting(completion:(_ setting:[NSObject:AnyObject]?, _ error:NSError?) -> Void)
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 4 of 19
2016-11-09, 9)34 AM
Requestable HTTPEncoding - Old: HTTPEncoding.URL New: HTTPEncoding.url - Old: HTTPEncoding.JSON New: HTTPEncoding.json - Old: HTTPEncoding.JSONArray([AnyObject]) New: HTTPEncoding.jsonArray([AnyObject]) - Old: HTTPEncoding.ImageUpload((image: UIImage, contentType: String, URL: String, additionalParams: [String:String]?, filename: String, uploadname: String)) New: HTTPEncoding.imageUpload((image: UIImage, contentType: String, URL: String, additionalParams: [String:String]?, filename: String, uploadname: String)) - Old: HTTPEncoding.PropertyList(NSPropertyListFormat, NSPropertyListWriteOptions) New: HTTPEncoding.propertyList(PropertyListSerialization.PropertyListFormat, PropertyListSerialization.WriteOptions) Old: HTTPEncoding.Custom(((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?))) New: HTTPEncoding.custom(((URLRequestConvertible, [String: AnyObject]?) -> (URLRequest, NSError?)))
FlybitsRequest Old: FlybitsRequest.URLRequest New: FlybitsRequest.urlRequest Old: HTTPSuccessStatusCodeRange New: httpSuccessStatusCode Old: public func parseList(response: NSHTTPURLResponse, list: [AnyObject]) -> [T] New: public func parse(_ list: [AnyObject], from response: HTTPURLResponse) -> [T]
FlybitsRequestType Old: FlybitsRequestType.Core New: FlybitsRequestType.core Old: FlybitsRequestType.Rules New: FlybitsRequestType.rules Old: FlybitsRequestType.ContextUpdate New: FlybitsRequestType.contextUpdate Old: FlybitsRequestType.Push New: FlybitsRequestType.push Old: FlybitsRequestType.Custom New: FlybitsRequestType.custom
Error Old: Error New: FLBError
CocoaError Old: CocoaError.FormattingError New: CocoaError.formattingError
CacheError Old: CacheError.TokenNotFound New: CacheError.tokenNotFound
CoreDataError Old: CoreDataError.StoreNotFound New: CoreDataError.storeNotFound
NetworkingRequestError Old: NetworkingRequestError.UnableToParseResponse New: NetworkingRequestError.unableToParseResponse Old: NetworkingRequestError.InvalidRequest New: NetworkingRequestError.invalidRequest Old: NetworkingRequestError.FlybitsUnavailable New: NetworkingRequestError.flybitsUnavailable Old: NetworkingRequestError.Unauthorized New: NetworkingRequestError.unauthorized Old: NetworkingRequestError.Forbidden New: NetworkingRequestError.forbidden Old: NetworkingRequestError.NotFound New: NetworkingRequestError.notFound Old: NetworkingRequestError.EmptyData New: NetworkingRequestError.emptyData Old: NetworkingRequestError.ExpectationNotMet New: NetworkingRequestError.expectationNotMet
SessionError Old: SessionError.NotConnected New: SessionError.notConnected Old: SessionError.AlreadyConnected New: SessionError.alreadyConnected
LoginError Old: LoginError.MissingRequiredData New: LoginError.missingRequiredData Old: LoginError.InvalidData New: LoginError.invalidData
RegistrationError Old: RegistrationError.MissingRequiredData New: RegistrationError.missingRequiredData Old: RegistrationError.InvalidData New: RegistrationError.invalidData
ContextError Old: ContextError.GeneralContextDataSendError New: ContextError.generalContextDataSendError Old: ContextError.ContextProviderAlreadyExists New: ContextError.contextProviderAlreadyExists Old: ContextError.UnableToCreateContextProvider New: ContextError.unableToCreateContextProvider
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 5 of 19
2016-11-09, 9)34 AM
Old: ContextError.EntityNotSupported New: ContextError.entityNotSupported Old: ContextError.InvalidData New: ContextError.invalidData
LocalizationError Old: LocalizationError.UnknownLanguageCode New: LocalizationError.unknownLanguageCode Old: LocalizationError.InvalidFormat New: LocalizationError.invalidFormat
ImageDownloadError Old: ImageDownloadError.InvalidURL New: ImageDownloadError.invalidURL Old: ImageDownloadError.LocalizationMissing New: ImageDownloadError.localizationMissing
JWTError Old: JWTError.MaxRetries New: JWTError.maxRetries
ErrorList Old: ErrorList.Array New: ErrorList.array
PushError Old: PushError.APNSTokenLength New: PushError.apnsTokenLength
APNSPreferenceError Old: APNSPreferenceError.ParseError New: APNSPreferenceError.parseError
CarrierDataProviderError Old: CarrierDataProviderError.NoCarrierError New: CarrierDataProviderError.noCarrierError
LanguageDataProviderError Old: LanguageDataProviderError.InvalidLanguageError New: LanguageDataProviderError.invalidLanguageError
AvailabilityDataProviderError Old: AvailabilityDataProviderError.CalendarAccessUnauthorized New: AvailabilityDataProviderError.calendarAccessUnauthorized
ActivityDataProviderError Old: ActivityDataProviderError.ActivityUnavailable New: ActivityDataProviderError.activityUnavailable
ActivityDataProviderError Old: ActivityDataProviderError.NoData New: ActivityDataProviderError.noData
AudioDataProviderError Old: AudioDataProviderError.NoNewData New: AudioDataProviderError.noNewData
ZoneCreationError Old: ZoneCreationError.NoDefaultLanguage New: ZoneCreationError.noDefaultLanguage Old: ZoneCreationError.NoLocalizations New: ZoneCreationError.noLocalizations
ToDictionaryError Old: ToDictionaryError.InvalidCoordinate New: ToDictionaryError.invalidCoordinate
RenditionType Old: RenditionType.Native New: RenditionType.native Old: RenditionType.HTML New: RenditionType.html Old: RenditionType.None New: RenditionType.none
Moment Old: Moment.id New: Moment.identifier file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 6 of 19
2016-11-09, 9)34 AM
Session Old: SessionStatus.Disconnected New: SessionStatus.disconnected Old: SessionStatus.Disconnecting New: SessionStatus.disconnecting Old: SessionStatus.Connecting New: SessionStatus.connecting Old: SessionStatus.Connected New: SessionStatus.connected Old: Session.jwtToken New: Session.jwt Old: public func validateSession(completion: (valid: Bool, currentUser: User?, error: NSError?) -> Void) -> FlybitsRequest New: public func reconnectSession(_ completion: @escaping (_ success: Bool, _ currentUser: User?, _ error: NSError?) -> Void) -> FlybitsRequest
SessionConfiguration Old: SessionConfiguration.APIKey New: SessionConfiguration.apiKey
User Old: User.id New: User.identifier Old: User.init(id:) New: User.init(identifier:) Old: public func updateDetails(dict: NSDictionary) New: public func updateDetails(from dict: NSDictionary) Old: public func updateProfileImage(image: Image) New: public func updateProfileImage(from image: Image) Old: public func updateProfile(newProfileInfo: UserProfile) New: public func updateProfile(from newProfileInfo: UserProfile)
Gender Old: Gender.NotSpecified New: Gender.notSpecified Old: Gender.Male New: Gender.male Old: Gender.Female New: Gender.female
Zone Old: Zone.id New: User.identifier Old: public func updateFromDictionary(dict: NSDictionary) -> Zone New: public func update(from dictionary: NSDictionary) -> Zone
UserProfile.Visibility Old: UserProfile.Visibility.OnlyMe New: UserProfile.Visibility.onlyMe Old: UserProfile.Visibility.FriendsOnly New: UserProfile.Visibility.friendsOnly Old: UserProfile.Visibility.Everyone New: UserProfile.Visibility.everyone Old: UserProfile.Visibility.Unknown New: UserProfile.Visibility.unknown Old: public class func userProfilefromDictionary(dict: NSDictionary) -> UserProfile New: public class func userProfile(from dict: NSDictionary) -> UserProfile Old: public func updateFromDictionary(dict: NSDictionary) -> UserProfile New: public func update(from dict: NSDictionary) -> UserProfile Old: public func updateFromProfile(newProfile: UserProfile) -> UserProfile New: public func update(from newProfile: UserProfile) -> UserProfile
Flybits SDK v2.0 This SDK enables applications to deliver context-aware solutions to iOS applications.
Release Notes Build with Xcode 7.3.1 (7D1014) using Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31) Supports iOS 8.0 and higher. Supports integration with Swift and Objective-C projects.
V 2.5.3 Added: An API PushRequest.RemoveNotification(...) to remove push message from notification history using PushMessage.id
V 2.5.2 Fixes: Context upload payload becomes too large and failed to send data; Added sentLatestValue which just sends the last known value for each context, thus, reducing payload size. By default, it's set to true. Added: isPolling property tell you whether ContextManager started polling data from each provider; It will return false when you call stopPollingData() on ContextManager
V 2.5.1
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 7 of 19
2016-11-09, 9)34 AM
The PushMessage object now includes two new fields: title and alert. The PushQuery provided to PushRequest.NotificationHistory can now control timestamp sort order (supports ascending and descending order). Bitcode is now included in all builds, previously due to a bug in Xcode's build script toolchain only the bitcode marker was being included. BUGFIXES: Fixed an issue where delete was being called twice for the user's APNS token on logout.
V 2.5.0 Alamofire has been removed from the SDK, which reduces its size by over 20% Zones can now be created, updated, deleted, published and unpublished All deprecated fields have been removed with the exception of the isConnected property, see the BREAKING CHANGES list below for details. A new API has been added to fetch a list of notifications received by this device by date range Developers can now control the callback queue of each FlybitsRequest, this allows fine grain control for each network request Query objects now have convenience initializers BREAKING CHANGES: The Generic versions of subscribeToNotification and unsubscribeFromNotification have been refactored to be more intelligent and only require an object rather than an object and an enum value. BooleanOperators have been removed from the SDK in favour of the more modern BooleanQuery construction. booleanTagExpression has been removed from the TagQuery object in favour of the TagQueryExpressions construction. boolTagExpr has been removed from the ZonesQuery object in favour of the ZonesQueryExpressions construction. Moment: instanceID is now momentInstanceID. Moment: momentType is now momentID. Session: isVerified was removed. Session: rememberMeToken was removed. Session: connectedZones was removed. Session: location was removed in favour of the CoreLocationDataProvider Context Plugin. Session: facebookID was removed. Session: twitterID was removed. Zone: numOfPeopleFavourited is now favouriteCount. Zone: momentInstanceTotalCount is now zoneMomentCount. Zone: isFavourite is now favouritedByUserIds. The ContextManager's registerContextProvider function is now available to Objective-C developers. BUGFIXES: When searching for Zones using the name and/or description fields an extra semi-colon was added, this has been fixed.
V 2.4.5 - NO HEALTH KIT Same as V2.4.5, but removes health kit
V 2.4.5 Disabled bitcode during built process
V 2.4.4 Deprecated the isConnected property in favour of a new status property (includes Connected, Disconnected and Connecting) BUGFIXES: Fixed an issue where an unauthenticated call could cause an authenticated call to reset session information.
V 2.4.3 Added a rememberMe API request for Objective-C developers that mirrors the Swift version. BUGFIXES: Fixed an issue where rememberMe was not available for Objective-C developers
V 2.4.2 BUGFIXES: Timestamp format was changed for location updates - this impacted the deprecated "location" property of the Session class. Re-added i386 simulator architecture Additional error information for APIs that are pre-parsed as JSON Fixed issue related to APNS token length (tokens can be between 32 and 100 hexadecimal characters). BREAKING CHANGES:
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 8 of 19
2016-11-09, 9)34 AM
The optionality of Zone.addressCoordinate has been removed and a default value of kCLLocationCoordinate2DInvalid has been provided. This makes the property available to Objective-C developers.
V 2.4.1 JWT and Remember Me are now available with Registration Utilities has now been renamed FlybitsUtilities for Objective-C compatibility (BREAKING CHANGE) New function available when retrieving results from a FlybitsRequest Moments now have two new properties momentID and momentInstanceID SyntheticLogin (and login:token:signature:fetchUserProfile:withCompletion:) now default to having rememberMe set to true. All errors have been updated to include more information in the following fields: localizedDescription, error.localizedFailureReason and localizedRecoverySuggestion (when available). BUGFIXES: Device Registration Data is now cleared on logout from the active PushConfiguration. MomentRequest.GetZoneMoments and MomentRequest.GetMomentsOfType were specifying UInt.max which caused the server to return 10 records rather than the max of 500 (server is using a 32-bit Int which was being overflowed). ZonesQuery was ignoring the value of searchField when specifying .PUBLISHED - the workaround was to specify no field and use the searchString to include the field. When uploading a profile image, specifying an empty image (nil) caused a crash in the SDK, this is now handled properly. OAuthConsentViewController now returns an error with no user info when an error page has been encountered, but the source is not able to be determined. Fetched push objects returned via the com.flybits.push.fetchedContent key were duplicating the entire structure (including the content, source and sourceContent fields) which was causing an unintended triple-nested structure to be returned. The simulator will now register a UUID for the vendor ID and retain it until the App has been deleted (the default behaviour is to generate a new Vendor UUID each time the App is run). Context plugins will now update the database when registering rather than being updated with old values. BREAKING CHANGES: Utilities now appears as FlybitsUtilities in Objective-C unsubscribeFromAllTopics has been removed, it is now an internal function used to clean up MQTT subscriptions. UserRequest.GetUsers now supports a Pager and always returns a list - no longer an optional list. MomentRequest.GetMomentsOfType has had its parameter momentID changed to type. ScheduleDataProviderErrror is now AvailabilityDataProviderError. UserActivityDataProviderError is now ActivityDataProviderError. NetworkingRequestError.FlybitsUnavailable used to be code 2, it is now code 503. NetworkingRequestError.Unauthorized used to be code 3, it is now code 401. NetworkingRequestError.Forbidden used to be code 4, it is now code 403. DEPRECATED FEATURES: Moment.instanceID Moment.momentType
has been replaced by Moment.momentInstanceID; to be removed in v2.5.0 has been replaced by Moment.momentID; to be removed in v2.5.0
Registration Updates When constructing an AccountQuery you can now specify fetchRememberMe and fetchJWT as options. Fetching a JWT is required for interacting with Push while remember me is helpful to ensure the user's session doesn't timeout. New FlybitsRequest Function Added responseObjectListPaged function to FlybitsRequest - if your API has data and pagination as the top-level fields, this function will automatically parse your objects (provided they support ResponseObjectSerializable) and return a pager as well.
V 2.4.0 Context Plugins are now available for Objective-C developers. Please review the developer portal documentation for full details. New Context Plugins are available (includes BREAKING CHANGES for ContextManager) Added API to retrieve a list of beacons for use with polling / ranging. BREAKING CHANGES: registerUnmanagedContextProvider(_:priority:pollFrequency:uploadFrequency) -> (ContextDataProvider?, NSError?) has had its signature registerSDKContextProvider(_:priority:pollFrequency:uploadFrequency) -> ContextDataProvider? to allow for use with Objective-C. The Calendar Context Plugin has been renamed to Availability The Cellular Context Plugin has been renamed to Carrier The User Activity Context Plugin has been renamed to Activity
changed:
BUG FIXES: Fix for issue where the ContextManager stopped fetching data if an error was returned via dataWithCompletion(completion:) New Context Plugins OAuthContextDataProvider:
While not a true ContextDataProvider subclass; this file provides a OAuthConsentViewController which shows a modal dialog to allow
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 9 of 19
2016-11-09, 9)34 AM
access for your Facebook or Spotify application via OAuth. Beacon API Added BeaconRequest.FetchMonitoredBeacons(...) (Swift only) API request to retrieve a list of beacons. It is intended to be used internally by the BeaconDataProvider if using iBeaconDataProvider or EddystoneDataProvider, you can issue a startBeaconQuery() request to fetch a list of beacons as provisioned in Experience Studio.
V 2.3.0 Swift 2.2 support, removed references to ++, -- and C-Style for loops: https://swift.org/blog/swift-2-2-new-features/ Updated Alamofire to v3.3.0 (to support Swift 2.2) New Context Plugins available (includes BREAKING CHANGES for ContextManager) Added support for X-Flybits-Authenticated header New push message types: Rule Associated, Rule Disassociated, Rule Updated, Moment Rule Associated, Moment Rule Disassociated, Moment Rule Updated Removed Advertising Identifier references All APIs that use gateway.flybits.com now use HTTPS MQTT client now uses SSL when communicating with Flybits servers Swift 2.2 Support Due to the Swift 2.2 update, a number of classes have been updated to support the following changes: - https://github.com/apple/swift-evolution/blob/master/proposals/0001keywords-as-argument-labels.md - https://github.com/apple/swift-evolution/blob/master/proposals/0003-remove-var-parameters.md - https://github.com/apple/swiftevolution/blob/master/proposals/0004-remove-pre-post-inc-decrement.md - https://github.com/apple/swift-evolution/blob/master/proposals/0007-remove-c-style-for-loops.md https://github.com/apple/swift-evolution/blob/master/proposals/0028-modernizing-debug-identifiers.md Alamofire v3.3.0 Due to Swift 2.2 changes, the version of Alamofire has been updated to the latest available: v3.3.0. While the Flybits SDK has supported v3 of Alamofire, this is a non-trivial update. See the release notes for further details: https://github.com/Alamofire/Alamofire/blob/master/CHANGELOG.md New Context Plugins New context plugins are available with the updated and improved ContextManager. Context plugin registration has been updated to no longer throw errors and will now return the plugin that was just registered. Plugins that are already registered will be updated with the values stored in the CoreData database. Battery
Reports current battery percentage and whether or not this device is charging. Location
Reports the user's current location. Can act as primary CLLocationManager and supports delegates or can be a delegate of an existing CLLocationManager. Network
Reports the user's current network status (WiFi vs. 3G) as well as any SSID they are connected to (when applicable). Beacons
Reports distance for beacons in the vicinity and can find beacons of both iBeacon and Eddystone type. Cellular
Reports SIM card info including MCC, MNC and Carrier. Language
Reports the preferred languages of the device. Schedule
Reports calendar density (total number of events today). User Activity
Reports the user's current activity type, i.e. Running, Walking, Driving. Flybits Authentication The Flybits servers now report a new header variable X-Flybits-Authenticated to indicate if your session has expired. The Flybits SDK will now clear Session information
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 10 of 19
2016-11-09, 9)34 AM
including currentUser, isConnected and other properties once the X-Flybits-Authenticated header has been set to false. Use the rememberMe feature of the SDK to avoid being logged out, or re-login once your Session has expired. NOTE: There is a notification com.flybits.current_user_changed that is available when the Session.sharedInstance.currentUser object has changed. New Push Message Types The PushManager now supports notifications related to Rules. If a rule is associated, disassociated or updated in relation to a Zone or Moment, there is a corresponding Notification broadcast. If the notification contains the Zone or Moment object then it is now available for your application based on the Rules governing that object. If the Zone or Moment object is nil, then the object is no longer available to your application (you can use the PushMessage's body property to retrieve the Zone or Moment's unique identifier id or momentID). Advertising Identifier The Utilities class used to provide a convenience property for accessing the Advertising Identifier, however some Apps do not use this identifier and were required to add info for their application when submitting to the App Store, this property has been removed as it is not a fundamental part of the SDK.
V 2.2.4 APIs now use the production url api.flybits.com for all projects. BREAKING CHANGES: - preferredLocales in the SessionConfiguration is no longer optional and will pull the device locale by default.
V 2.2.3 Added support for additional, user-defined properties when registering an APNS token. Added support for toggling automatic saving of PushPreferences on and off. Added support for additional push message types. Added createdAt and lastModifiedAt properties on Zone, Moment and User objects. Added support for SDK to report version number when issuing Core, Push and Context API requests. BREAKING CHANGES: - SessionConfiguration no longer has a deploymentTarget property. This field is no longer required, your API Key will automatically detect the proper environment and tenant. Bug Fixes: - JWT is now being generated after user registration. - APNS token is now removed on logout.
Push Token Properties The PushConfiguration in the PushManager now supports additional fields which are passed, unmodified, to the Push server. This allows for an application which uses the SDK to customize the Push envelope - typically used when Flybits' push services will be forwarding push messages to a third party agent. To provide a field, simply pass it using one of the new convenience constructors: // Swift let aServiceLevel = PushServiceLevel.Foreground // or .Background, or .Both let apnsToken = <APNS Token Received from Apple> let deviceRegistrationData: [String : AnyObject] = [ "My Field Name" : "My Field Value" ]
PushManager.sharedManager.configuration = PushConfiguration.configurationWithServiceLevel(serviceLevel: aServiceLevel, apnsToken: apnsToken, andDeviceRe // Objective-C PushServiceLevel aServiceLevel = PushServiceLevelForeground; // or PushServiceLevelBackground, or PushServiceLevelBoth NSData *apnsToken = <APNS Token Received from Apple> NSDictionary *deviceRegistrationData = @{ @"My Field Name" : @"My Field Value" };
PushManager.sharedManager.configuration = [PushConfiguration configurationWithServiceLevel: aServiceLevel apnsToken: apnsToken andDeviceRegistrationData
Auto Save Push Preferences The PushConfiguration in the PushManager offers a new flag autoSavePushPreferences - prior to this release, PushPreferences were saved each time a change was made. If the auto save flag is set to false, a developer can issue a number of updates and manually call PushManager.sharedManager.backgroundPreferences.save() to avoid unnecessary network traffic. Additional Push Message Types Zone
push messages now support the following actions: Created Modified Deleted Entered
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 11 of 19
2016-11-09, 9)34 AM
Exited RoleModified MomentModified MomentRoleModified MomentDeleted MomentInstance
messages now support the following actions:
Created Modified Deleted ZoneEntered ZoneExited RoleModified MomentDeleted Custom ZoneMomentInstance
messages now support the following actions:
Created Modified Deleted Custom User
messages now support the following actions: Logged In Logged Out
Tag
messages now support the following actions: Created Modified Deleted
V 2.2.2 Added support for APNS preferences. Added support for disabling the currently logged in user. Added support for MQTT re-connect when JWT expires or pipe is broken by App sleep. Updated request headers to include device identifier as a standard field. Updated request headers to include SDK version. BREAKING CHANGES: - DeviceRequest.Connect no longer requires a device ID as a parameter. BEHAVIOUR CHANGES: - Any headers passed via the headers property of a Requestable will now override existing headers from the SDK. Bug Fixes: - Flybits SDK no longer calls the fetchCompletionHandler for notifications that aren't handled (i.e. When returning false from notificationReceived:fetchCompletionHandler:). - Device IDs are now stored on a per-API-key basis, this fixes the issue where an App using multiple API keys would fail to log into MQTT. APNS Preferences Developers can now specify whether or not they wish to receive foreground (APNS) pushes from the push moment by providing appropriate identifiers. I.E. If a user wishes to no longer receive pushes from Offer tags, simply call unsubscribeFromPush() on the Tag object, or PushManager.sharedManager.unsubscribeFromNotification(.Tag, ), or PushManager.sharedManager.unsubscribeFromTopic(.id) Using the PushManager.Constants.PushPreferencesUpdatedTopic, push preferences use the push broadcast mechanism to identify when preferences have been updated (either an initial load or a successful save). If an error is encountered while loading or saving the PushManager.Constants.PushPreferencesErrorTopic is used. Disable User Developers can now disable user accounts using the SDK. Developers can only disable the currently active user. They can do this by calling <User Object>.disable(), Session.sharedInstance.currentUser?.disable() or using a UserRequest.Disable or APIManager.disableUser call.
V 2.2.1.1 Bugfix Version
V 2.2.1 Added improved support for push messaging channels. Added Moment category for push messages. Eased restrictions on supported entities and action combinations. Added builds for App Store quality SDKs (no longer includes Simulators).
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 12 of 19
2016-11-09, 9)34 AM
Push Notification Improvements An PushMessageCategory of Moment is now available - this type of category is received when the push notification moment is responsible for triggering an APNS message. In addition to the typical channels available via NotificationType(, ), more specific channels are available via CompleteNotificationType(, , ) This change provides support for completely custom messages as well as receiving push notifications for individual Zone, Moment and User objects. Sample Usage // Swift // Provides access to all modified messages of a given Tenant let zoneNotification = PushMessage.NotificationType(.Zone, action: .Modified) NSNotificationCenter.defaultCenter().addObserverForName(zoneNotification, object: nil, queue: nil) { (notification) -> Void in // Standard notification handling } // Provides access to all modified messages for a given Zone ID let zone: Zone = let specificZoneNotification = PushMessage.CompleteNotificationType(.Zone, action: Modified, rawAction: zone.id) NSNotificationCenter.defaultCenter().addObserverForName(specificZoneNotification, object: nil, queue: nil) { (notification) -> Void in // Standard notification handling } // Objective-C // Provides access to all modified messages of a given Tenant NSString *zoneNotification = [PushMessage NotificationType:PushMessageEntityZone action: PushMessageActionModified]; [NSNotificationCenter.defaultCenter addObserverForName:zoneNotification object: nil queue: nil usingBlock:^(NSNotification *notification) { // Standard notification handling }]; // Provides access to all modified messages for a given Zone ID Zone *zone = NSString *specificZoneNotification = [PushMessage CompleteNotificationType:PushMessageEntityZone action: PushMessageActionModified rawAction:zone.id]; [NSNotificationCenter.defaultCenter addObserverForName:zoneNotification object: nil queue: nil usingBlock:^(NSNotification *notification) { // Standard notification handling }];
[Swift Only] Additionally, Zone and Moment objects can be used to retrieve push message subscription topics. A variant of the NotificationType and CompleteNotificationType functions accept objects conforming to the PushConfigurable protocol. Using the two new properties on the protocol (id and pushEntityType) the function can do a lookup on your behalf and assemble the proper NotificationType or CompleteNotificationType. Sample Usage // Swift let zone: Zone = // Provides access to all modified messages of a given Tenant let zoneNotification = PushMessage.NotificationType(zone, action: .Modified) NSNotificationCenter.defaultCenter().addObserverForName(zoneNotification, object: nil, queue: nil) { (notification) -> Void in // Standard notification handling } // Provides access to all modified messages for a given Zone ID let specificZoneNotification = PushMessage.CompleteNotificationType(zone, action: Modified) NSNotificationCenter.defaultCenter().addObserverForName(specificZoneNotification, object: nil, queue: nil) { (notification) -> Void in // Standard notification handling } // Objective-C is not supported as it lacks Swift Generics support.
V 2.2.0 Added support for foreground and background push notifications. Added support for NSURLSession timeout. Added support for Constants. Added support for Boolean Queries. Added improved support for localized objects. The sources for XCGLogger have been integrated into the Flybits SDK and are no longer distributed as a separate .Framework. License information is available here: https://github.com/DaveWoodCom/XCGLogger/blob/master/LICENSE.txt (MIT style licensing). Push Notification Additions The Flybits SDK now supports push notifications. Developers can configure the types of push notifications they wish to receive. After logging into Flybits, developers can provide a PushConfiguration to the shared PushManager. A login is required as the user's ID and device ID are required to register with APNS and MQTT. Sample Usage
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 13 of 19
2016-11-09, 9)34 AM
// Swift let serviceLevel = PushServiceLevel.Both // Options include .None, .Foreground, .Background, .Both let apnsToken = <APNS Token Received from Apple> PushManager.sharedManager.configuration = PushManager(serviceLevel: serviceLevel, apnsToken: apnsToken) // Objective-C
PushServiceLevel serviceLevel = PushServiceLevelBoth; // Options include PushServiceLevelNone, PushServiceLevelForeground, PushServiceLevelBackground, P NSData *apnsToken = <APNS Token Received from Apple>; PushManager.sharedManager.configuration = [[PushManager alloc] initWithServiceLevel:serviceLevel apnsToken:apnsToken];
NOTE: To activate Foreground push, updating the serviceLevel property of the current PushConfiguration is not enough to initiate or cancel a connection to the MQTT server, a new PushConfiguration must be provided. Conversely, activating Background push can be achieved by updating the APNS token in the active PushConfiguration without providing a new configuration object. Foreground push notifications use the MQTT protocol to communicate with a Rabbit MQ server. Topics can be actively subscribed using hooks in existing objects (Zone and Moment) or subscribing directly to a topic by name. // Swift let myZone = myZone.subscribeToPush() // Objective-C Zone *myZone = ; [myZone subscribeToPush];
Subscribing to background notifications requires an APNS token to be provided to the PushConfiguration. Controlling which notifications will be received is not part of this update. In a future update a PushPreferences object will be added to communicate with the server. // Swift let apnsToken = <APNS Token Received from Apple> PushManager.sharedManager.configuration.apnsToken = apnsToken // Objective-C NSData *apnsToken = <APNS Token Received from Apple>; PushManager.sharedManager.configuration.apnsToken = apnsToken;
Both methods of push notifications will receive callbacks via NSNotificationCenter. The PushMessage class provides a static function (NotificationType) for retrieving notification type keys - these same keys will be used when publishing a push notification. // Swift PushMessage.NotificationType(, action: ) // Objective-C [PushMessage NotificationType: action:];
When receiving a notification via NSNotificationCenter, the userInfo property will be populated in the following format: // Both Swift and Objective-C [ "com.flybits.push.content" "com.flybits.push.source" "com.flybits.push.sourceContent" "com.flybits.push.fetchedContent" ]
: : : :
PushMessage // A PushMessage object PushSource // APNS or MQTT APS Content // This is an optional entry that will contain the APS content of an APNS push message A Flybits model object // i.e. a Zone or Moment
Please note that if the com.flybits.push.fetchedContent key is missing, a com.flybits.push.fetchError key will be in its place along with a value of com.flybits.push.error.fetchEmpty or an NSError when available. NOTE: com.flybits.push.content is available as a constant: PushManager.Constants.PushContent NOTE: com.flybits.push.source is available as a constant: PushManager.Constants.PushSource NOTE: com.flybits.push.sourceContent is available as a constant: PushManager.Constants.PushSourceContent NOTE: com.flybits.push.fetchedContent is available as a constant: PushManager.Constants.PushFetchedContent NOTE: com.flybits.push.fetchError is available as a constant: PushManager.Constants.FetchError Clients can listen for the MQTT connect and disconnect events as well (typically the connect event happens very quickly and you must register before issuing a Flybits Login request). These are available with the following keys com.flybits.push.connected and com.flybits.push.disconnected respectively. NOTE: com.flybits.push.connected is available as a constant: PushManager.Constants.PushConnected NOTE: com.flybits.push.disconneced is available as a constant: PushManager.Constants.PushDisconnected There are a number of errors that can popup while push messages are being parsed and/or evaluated. If an error was encountered while parsing an MQTT or APNS message, a message will be broadcast using the com.flybits.push.error key with a userInfo property containing the following content: // Both Swift and Objective-C [ "com.flybits.push.error.type" : <Error Type> (See below) ]
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 14 of 19
2016-11-09, 9)34 AM
// // // //
com.flybits.push.error.payloadEmpty - Refers to an APNS message missing the 'aps' section of the payload. Likely causes include: An invalid or garble com.flybits.push.error.payloadData - Refers to a missing 'data' section of the payload. Likely causes include: not a Flybits APNS message, a garbled com.flybits.push.error.payloadFormat - Refers to a 'data' section that was not base 64 encoded. Likely causes include: not a Flybits APNS message, a com.flybits.push.error.parse - Refers to a 'data' section that was not properly formatted according to Flybits messaging standards.
NOTE: com.flybits.push.error is available as a constant: PushManagerConstants.PushError NOTE: com.flybits.push.error.type is available as a constant: PushManagerConstants.PushErrorType NOTE: com.flybits.push.error.payloadEmpty is available as a constant: PushManagerErrorConstants.PayloadEmpty NOTE: com.flybits.push.error.payloadData is available as a constant: PushManagerErrorConstants.PayloadData NOTE: com.flybits.push.error.payloadFormat is available as a constant: PushManagerErrorConstants.PayloadFormat NOTE: com.flybits.push.error.parse is available as a constant: PushManagerErrorConstants.Parse NOTE: com.flybits.push.error.fetchEmpty is available as a constant: PushManagerErrorConstants.FetchEmpty Finally, should an APNS message fail to be parsed, the notificationReceived function will return false so your application can attempt to parse the notification itself. A typical scenario for this would be a forwarded message was not intended for the Flybits SDK. NSURLSession Timeout Additions A new static property, timeoutIntervalForRequest has been added to the FlybitsRequest class, you can set it directly with a timeout value of your choosing. Please note that the timeout value applies to all requests, there is currently no way to set individual timeouts in the Flybits SDK. It is important to set your session timeout value before logging in to Flybits servers as a new session is created when a new value timeoutIntervalForRequest has been provided, as such your session will need to be re-initialized with Flybits when a new NSURLSession is created. NOTE: NSURLRequest has different minimum timeout values across each version of iOS, bear that in mind when setting a new value. The minimum recommended value is 40 (seconds) Sample Usage // Swift: // 1. Set the timeout FlybitsRequest.timeoutIntervalForRequest = 35 // Seconds // 2. Create a request let longRequest = NSMutableURLRequest(URL: NSURL(string: "http://example.com/long_task")!) let flybitsRequest = FlybitsRequest(request: longRequest) flybitsRequest.response { (request, response, data: [String : AnyObject]?, error) -> Void in // 3. Handle the result if let error = error where error.code == NSURLErrorTimedOut { // Handle error. } if let error = error { // Handle other errors. } // Handle success. } // Objective-C: // 1. Set the timeout [FlybitsRequest setTimeoutIntervalForRequest:35]; // Seconds // 2. Create a request NSURLRequest *longRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com/long_task"]]; FlybitsRequest *flybitsRequest = [[FlybitsRequest alloc] initWithRequest:longRequest]; [flybitsRequest responseStringWithCompletionHandler:^(NSURLRequest *request, NSHTTPURLResponse *response, NSString *data, NSError *error) { // 3. Handle the result if (error.code == NSURLErrorTimedOut) { // Handle error. } if (error != nil) { // Handle other errors } // Handle success. }];
Constant Additions Constants are now availble for various Query objects. ZonesQuery, UsersQuery, MomentQuery and TagQuery now expose a number of constants. These constants can be used in the include and exclude fields of each API respectively to reduce API payload size. Additionally, the PushManager exposes some constants for subscribing to notifications and decomposing a payload, see the PushManager documentation for additional details. NOTE: When using Objective-C, drop the period (.) between the Query and the Constant as nested classes are not supported. I.E. ZonesQuery.Constants.Metadata becomes ZonesQueryConstants.Metadata. Sample Usage // Swift: let query = ZonesQuery() query.excludes = [ZonesQuery.Constants.Metadata]
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 15 of 19
2016-11-09, 9)34 AM
// By excluding Metadata, none of its data will be retrieved by the server (thus decreasing the payload) // and the property will be nil in any Zone returned ZoneRequest.Query(query) { (zones, pagination, error) -> Void in guard error == nil else { // Handle error return } guard zones != nil else { // Handle empty list return } // Handle Zones }.execute() // Objective-C ZonesQuery *query = [[ZonesQuery alloc] init]; query.excludes = @[ZonesQueryConstants.Metadata]; // By excluding Metadata, none of its data will be retrieved by the server (thus decreasing the payload) // and the property will be nil in any Zone returned [APIManager zoneQuery:query withCompletion:^(Array *zones, Pager *pagination, NSError *error) { if(error != nil || zones == nil) { // Handle error / empty list return } // Handle Zones }];
Boolean Query Additions Added additional support for querying items using Boolean operators. This is an improved version of the BooleanExpression operation on the ZoneQuery class and will likely replace BooleanExpression and BooleanExpressables in a breaking release (i.e. 3.x) Boolean operators allow any query object that supports a list of GUIDs (implemented as Strings in the Flybits SDK) to use boolean expressions (AND, OR) to control the behaviour of a Flybits API request. Constructing a BooleanQuery is as simple as providing a single element. Adding additional elements is handled via the AND(item[s]) or OR(item[s]) functions. It is important to note the distinction between the AND/OR functions and the AND/OR operators; when specifying a list of elements to either an AND or OR function, you can also specify the operation between the elements in the list via the AND/OR operators. Consider the expression: (A AND B) OR (B AND C) // Swift
let query = BooleanQuery(["A", "B"], AND) // Denotes that "A" should be ANDed with "B", or (A AND B) query.OR(["B", "C"], AND) // Denotes that "B" should be ANDed with "C", but the list should be ORed with the existing elements, or (A AND B) OR (B AND C // Objective-C
BooleanQuery *query = [[BooleanQuery alloc] init:@[@"A", @"B"] :BooleanQueryOpAND]; // Denotes that "A" should be ANDed with "B", or (A AND B) [query OR:@[@"B", @"C"] :BooleanQueryOpAND]; // Denotes that "B" should be ANDed with "C", but the list should be ORed with the existing elements, or (A
2 New classes were added that allow boolean-style queries on existing APIs: ZonesQueryExpressions TagQueryExpressions Sample Usage
Retrieve a Zone created by (userA AND userB) OR (userB AND userC) // Swift let query = BooleanQuery(["userA", "userB"], .AND) .OR(["userB", "userC"], .AND) let zoneQueryExpression = ZonesQueryExpressions(limit: 10, offset: 0) zoneQueryExpression.userIDQuery = query ZoneRequest.Query(zoneQueryExpression) { (zones, pagination, error) -> Void in guard error == nil else { // Handle error return } guard zones != nil else { // Handle empty list return } // Handle Zones }.execute() // Objective-C
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 16 of 19
2016-11-09, 9)34 AM
BooleanQuery *query = [[BooleanQuery alloc] init:@[@"userA", @"userB"] :BooleanQueryOpAND]; [query OR:@[@"userB", @"userC"] :BooleanQueryOpAND]; ZonesQueryExpressions *zoneQueryExpression = [[ZonesQueryExpressions alloc] initWithLimit:10 offset:0]; zoneQueryExpression.userIDQuery = query; [APIManager zonesQuery:zoneQueryExpression withCompletion:^(NSArray *zones, Pager *page, NSError *error) { if(error != nil || zones == nil) { // Handle error / empty list return } // Handle Zones }];
Improved Localization Support LocalizedObject has been updated to support cases where a given localization is not available (and can return a nil type). Zone, Moment and Image have been updated to support this new model. Zone The following properties have had a nullability change from nonnull to nullable: ​- (NSString * __nullable)zoneName; - (NSString * __nullable)localizedName:(NSLocale * __nonnull)locale; - (NSString * __nullable)zoneDesc; - (NSString * __nullable)localizedZoneDescription:(NSLocale * __nonnull)locale;
The following function was added to return the default locale as defined on the server: - (NSLocale * __nullable) defaultLocale;
Image The following functions were added: - (BOOL)imageAvailable:(NSLocale * __nonnull)locale; - (BOOL)imageAvailableForLanguageCode:(NSString * __nonnull)languageCode; - (NSLocale * __nullable) defaultLocale;
Moment The following properties nullability changed from nonnull to nullable - (NSString * __nullable)momentName; - (NSString * __nullable)localizedName:(NSLocale * __nonnull)locale;
The following function was added to return the default locale as defined on the server: - (NSLocale * __nullable) defaultLocale;
V 2.1.3 Bugfix Version
V 2.1.2 Bugfix Version
V 2.1.1 Added support for images on Tag objects. Tag
Additions
Tags now have a property image which is an Image object. Images provide access to URLs by localization as well as any loadedImage or rawData that has been previously loaded. Refer to the relevant documentation for full info.
V 2.1.0 Added support for BooleanOperator (Swift) and BooleanExpressable (Objective-C). Boolean Operator Additions Boolean operators are to be used when a set of Zones needs to be filtered using tags. NOTE: Do not use Boolean operators when a simple -or- of tags is required (i.e. Tag 1 OR Tag 2 OR Tag 3), use the tagIds property of the ZonesQuery object. Example 1: Tag1 -AND- Tag2 (where each tag is in the format 00000000-0000-0000-0000-000000000000) file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 17 of 19
2016-11-09, 9)34 AM
// Swift let query = ZonesQuery() query.booleanTagExpression = .AND(.Value(key: "tagId", value: Tag_1), .Value(key: "tagId", value: Tag_2)) ZoneRequest.Query(query) { (zones, pagination, error) -> Void in guard error == nil else { // Handle error return } guard zones != nil else { // Handle empty list return } // Handle Zones }.execute() // Objective-C ZonesQuery *query = [[ZonesQuery alloc] init]; query.boolTagExpr = [AndBExpr left:[ValueBExpr key:"tagId" value:Tag_1] right:[ValueBExpr key:"tagId" value:Tag_2]]; [APIManager zoneQuery:query withCompletion:^(Array *zones, Pager *pagination, NSError *error) { if(error != nil || zones == nil) { // Handle error / empty list return } // Handle Zones }];
Updated Image class to support new sizes and provide better access to UIImage and raw image data. ImageSize
enum
Removed: Icon Small Large
Added: ._100 ._80 ._60 ._40 ._20
Properties Removed: downloadState imageMetadata Image
Functions
Updated: urlString NOW: urlString:ImageSize locale:NSLocale loadImage:CGSize locale:NSLocale completion:^(Image, NSError) loadLocalizedImage:CGSize locale:NSLocale completion:^(Image, NSError) NOW: loadImage:ImageSize locale:NSLocale withCompletion:^(Image, NSError) APIManager
Functions
Updated: downloadImage:Image locale:NSLocale size:CGSize withCompletion:^(UIImage, NSError) NOW: downloadImage:Image locale:NSLocale size:ImageSize withCompletion:^(UIImage, NSError) Added: downloadRawImage:Image locale:NSLocale imageSize:ImageSize withCompletion:^(NSData, NSError) file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 18 of 19
2016-11-09, 9)34 AM
[Convenience] downloadRawImage100:Image withCompletion:^(NSData, NSError) [Convenience] downloadRawImage100ForLocale:Image locale:NSLocale withCompletion:^(NSData, NSError) [Convenience] downloadImage100:Image withCompletion:^(UIImage, NSData) // Downloads an image @ 100% [Convenience] downloadImage100ForLocale:Image locale:NSLocale withCompletion:^(UIImage, NSData) // Downloads an image @ 100% Sample Usage // Swift if let image = zone.image.loadedImage(._100) { // Use image _imageView.image = image } else { // Option #1 - Updates internal object zone.image.loadImage(._100) { (image, error) -> Void in if let loadedImage = image.loadedImage(._100) { _imageView.image = loadedImage } } // Option #2 - Does not update internal object ImageRequest.Download(zone.image, locale:nil, imageSize:._100) { (loadedImage, error) guard error == nil && loadedImage != nil else { // Handle error return } _imageView.image = loadedImage! }.execute() // Option #3 - Does not update internal object ImageRequest.DownloadRaw(zone.image, locale:nil, imageSize:._100) { (data, error) guard error == nil && data != nil else { // Handle error return } if let image = UIImage(data: data!) { _imageView.image = image } }.execute() } // Objective-C UIImage *image = [zone.image loadedImage:ImageSize_100 locale:nil]; if(image == nil) { // Option #1 - Updates internal object [zone.image loadImage:ImageSize_100 locale:nil withCompletion:^(Image *image, NSError *error) { UIImage *loadedImage = [image loadedImage:ImageSize_100 locale:nil]; if (loadedImage) { _imageView.image = loadedImage; } }]; // Option #2 - Does not update internal object [APIManager downloadImage:zone.image locale:nil imageSize:ImageSize_100 withCompletion:^(UIImage *loadedImage, NSError *error) { if(loadedImage) { _imageView.image = loadedImage; } }]; // Option #3 - Does not update internal object [APIManager downloadRawImage:zone.image locale:nil imageSize:ImageSize_100 withCompletion:^(NSData *rawData, NSError *error) { if(rawData) { _imageView.image = [UIImage imageWithData:rawData]; } }]; } else { _imageView.image = image; }
file:///Users/chuthan20/V3.2/FlybitsSDK-Latest-Release-Notes.html
Page 19 of 19