diff --git a/Frameworks/Bindings.xcframework/Info.plist b/Frameworks/Bindings.xcframework/Info.plist index 5da456bbdabbf3d610daca4ce17734b523413a53..3c96df61083ca794226526858401b4539235d6ba 100644 --- a/Frameworks/Bindings.xcframework/Info.plist +++ b/Frameworks/Bindings.xcframework/Info.plist @@ -6,30 +6,30 @@ <array> <dict> <key>LibraryIdentifier</key> - <string>ios-arm64</string> + <string>ios-arm64_x86_64-simulator</string> <key>LibraryPath</key> <string>Bindings.framework</string> <key>SupportedArchitectures</key> <array> <string>arm64</string> + <string>x86_64</string> </array> <key>SupportedPlatform</key> <string>ios</string> + <key>SupportedPlatformVariant</key> + <string>simulator</string> </dict> <dict> <key>LibraryIdentifier</key> - <string>ios-arm64_x86_64-simulator</string> + <string>ios-arm64</string> <key>LibraryPath</key> <string>Bindings.framework</string> <key>SupportedArchitectures</key> <array> <string>arm64</string> - <string>x86_64</string> </array> <key>SupportedPlatform</key> <string>ios</string> - <key>SupportedPlatformVariant</key> - <string>simulator</string> </dict> </array> <key>CFBundlePackageType</key> diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings index 551a016dc73fb80d2f4599f71f9741105273633e..7267786097f1d59d877cf3d9be1a9fca83a91afb 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h index a56558d0ae166ee09f92bcb66c592ff5fae5c131..f625ef9e8b761631a702b1b07fc6dc56c78b229c 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h @@ -404,6 +404,11 @@ Parameters: * GetID returns the ID for this Cmix in the cmixTracker. */ - (long)getID; +/** + * GetReceptionRegistrationValidationSignature returns the signature provided by +the xx network. + */ +- (NSData* _Nullable)getReceptionRegistrationValidationSignature; /** * HasRunningProcessies checks if any background threads are running and returns true if one or more are. @@ -724,6 +729,17 @@ The first payload is index 0. * PayloadSize returns the max payload size for a partitionable E2E message. */ - (long)payloadSize; +/** + * RegisterListener registers a new listener. + +Parameters: + - senderId - the user ID who sends messages to this user that + this function will register a listener for. + - messageType - message type from the sender you want to listen for. + - newListener: A provider for a callback to hear a message. + Do not pass nil to this. + */ +- (BOOL)registerListener:(NSData* _Nullable)senderID messageType:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * RemoveService removes all services for the given tag. */ @@ -1329,6 +1345,15 @@ object. - (BOOL)unsetAlternativeUserDiscovery:(NSError* _Nullable* _Nullable)error; @end +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedCode; +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedMessage; + /** * AsyncRequestRestLike sends an asynchronous restlike request to a given contact. @@ -1345,6 +1370,23 @@ of JSON marshalling the response when received. */ FOUNDATION_EXPORT BOOL BindingsAsyncRequestRestLike(long e2eID, NSData* _Nullable recipient, NSData* _Nullable request, NSData* _Nullable paramsJSON, id<BindingsRestlikeCallback> _Nullable cb, NSError* _Nullable* _Nullable error); +/** + * CreateUserFriendlyErrorMessage will convert the passed in error string +to an error string that is user-friendly if a substring match is +found to a common error. Common errors is a map which can be updated +using UpdateCommonErrors. If the error is not common, some simple parsing +is done on the error message to make it more user-accessible, removing +backend specific jargon. + +Parameters + - errStr - an error returned from the backend. + +Returns + - A user-friendly error message. This should be devoid of technical speak + but still be meaningful for front-end or back-end teams. + */ +FOUNDATION_EXPORT NSString* _Nonnull BindingsCreateUserFriendlyErrorMessage(NSString* _Nullable errStr); + /** * DownloadAndVerifySignedNdfWithUrl retrieves the NDF from a specified URL. The NDF is processed into a protobuf containing a signature that is verified @@ -1488,6 +1530,10 @@ FOUNDATION_EXPORT BindingsCmix* _Nullable BindingsLoadCmix(NSString* _Nullable s Parameters: - e2eID - e2e object ID in the tracker - follower - network follower func wrapped in UdNetworkStatus + - username - the username the user wants to register with UD. + If the user is already registered, this field may be blank + - registrationValidationSignature - the signature provided by the xx network. + This signature is optional for other consumers who deploy their own UD. */ FOUNDATION_EXPORT BindingsUserDiscovery* _Nullable BindingsLoadOrNewUserDiscovery(long e2eID, id<BindingsUdNetworkStatus> _Nullable follower, NSString* _Nullable username, NSData* _Nullable registrationValidationSignature, NSError* _Nullable* _Nullable error); @@ -1711,6 +1757,21 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); +/** + * UpdateCommonErrors updates the internal error mapping DB. This internal database +maps errors returned from the backend to user-friendly error messages. + +Parameters + - jsonFile - contents of a JSON file whose format conforms to the example below. +Example Input: + { + "Failed to Unmarshal Conversation": "Could not retrieve conversation", + "Failed to unmarshal SentRequestMap": "Failed to pull up friend requests", + "cannot create username when network is not health": "Cannot create username, unable to connect to network", + } + */ +FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, NSError* _Nullable* _Nullable error); + @class BindingsAuthCallbacks; @class BindingsBroadcastListener; diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings index 551a016dc73fb80d2f4599f71f9741105273633e..7267786097f1d59d877cf3d9be1a9fca83a91afb 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h index a56558d0ae166ee09f92bcb66c592ff5fae5c131..f625ef9e8b761631a702b1b07fc6dc56c78b229c 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -404,6 +404,11 @@ Parameters: * GetID returns the ID for this Cmix in the cmixTracker. */ - (long)getID; +/** + * GetReceptionRegistrationValidationSignature returns the signature provided by +the xx network. + */ +- (NSData* _Nullable)getReceptionRegistrationValidationSignature; /** * HasRunningProcessies checks if any background threads are running and returns true if one or more are. @@ -724,6 +729,17 @@ The first payload is index 0. * PayloadSize returns the max payload size for a partitionable E2E message. */ - (long)payloadSize; +/** + * RegisterListener registers a new listener. + +Parameters: + - senderId - the user ID who sends messages to this user that + this function will register a listener for. + - messageType - message type from the sender you want to listen for. + - newListener: A provider for a callback to hear a message. + Do not pass nil to this. + */ +- (BOOL)registerListener:(NSData* _Nullable)senderID messageType:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * RemoveService removes all services for the given tag. */ @@ -1329,6 +1345,15 @@ object. - (BOOL)unsetAlternativeUserDiscovery:(NSError* _Nullable* _Nullable)error; @end +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedCode; +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedMessage; + /** * AsyncRequestRestLike sends an asynchronous restlike request to a given contact. @@ -1345,6 +1370,23 @@ of JSON marshalling the response when received. */ FOUNDATION_EXPORT BOOL BindingsAsyncRequestRestLike(long e2eID, NSData* _Nullable recipient, NSData* _Nullable request, NSData* _Nullable paramsJSON, id<BindingsRestlikeCallback> _Nullable cb, NSError* _Nullable* _Nullable error); +/** + * CreateUserFriendlyErrorMessage will convert the passed in error string +to an error string that is user-friendly if a substring match is +found to a common error. Common errors is a map which can be updated +using UpdateCommonErrors. If the error is not common, some simple parsing +is done on the error message to make it more user-accessible, removing +backend specific jargon. + +Parameters + - errStr - an error returned from the backend. + +Returns + - A user-friendly error message. This should be devoid of technical speak + but still be meaningful for front-end or back-end teams. + */ +FOUNDATION_EXPORT NSString* _Nonnull BindingsCreateUserFriendlyErrorMessage(NSString* _Nullable errStr); + /** * DownloadAndVerifySignedNdfWithUrl retrieves the NDF from a specified URL. The NDF is processed into a protobuf containing a signature that is verified @@ -1488,6 +1530,10 @@ FOUNDATION_EXPORT BindingsCmix* _Nullable BindingsLoadCmix(NSString* _Nullable s Parameters: - e2eID - e2e object ID in the tracker - follower - network follower func wrapped in UdNetworkStatus + - username - the username the user wants to register with UD. + If the user is already registered, this field may be blank + - registrationValidationSignature - the signature provided by the xx network. + This signature is optional for other consumers who deploy their own UD. */ FOUNDATION_EXPORT BindingsUserDiscovery* _Nullable BindingsLoadOrNewUserDiscovery(long e2eID, id<BindingsUdNetworkStatus> _Nullable follower, NSString* _Nullable username, NSData* _Nullable registrationValidationSignature, NSError* _Nullable* _Nullable error); @@ -1711,6 +1757,21 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); +/** + * UpdateCommonErrors updates the internal error mapping DB. This internal database +maps errors returned from the backend to user-friendly error messages. + +Parameters + - jsonFile - contents of a JSON file whose format conforms to the example below. +Example Input: + { + "Failed to Unmarshal Conversation": "Could not retrieve conversation", + "Failed to unmarshal SentRequestMap": "Failed to pull up friend requests", + "cannot create username when network is not health": "Cannot create username, unable to connect to network", + } + */ +FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, NSError* _Nullable* _Nullable error); + @class BindingsAuthCallbacks; @class BindingsBroadcastListener; diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings index 551a016dc73fb80d2f4599f71f9741105273633e..7267786097f1d59d877cf3d9be1a9fca83a91afb 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h index a56558d0ae166ee09f92bcb66c592ff5fae5c131..f625ef9e8b761631a702b1b07fc6dc56c78b229c 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h @@ -404,6 +404,11 @@ Parameters: * GetID returns the ID for this Cmix in the cmixTracker. */ - (long)getID; +/** + * GetReceptionRegistrationValidationSignature returns the signature provided by +the xx network. + */ +- (NSData* _Nullable)getReceptionRegistrationValidationSignature; /** * HasRunningProcessies checks if any background threads are running and returns true if one or more are. @@ -724,6 +729,17 @@ The first payload is index 0. * PayloadSize returns the max payload size for a partitionable E2E message. */ - (long)payloadSize; +/** + * RegisterListener registers a new listener. + +Parameters: + - senderId - the user ID who sends messages to this user that + this function will register a listener for. + - messageType - message type from the sender you want to listen for. + - newListener: A provider for a callback to hear a message. + Do not pass nil to this. + */ +- (BOOL)registerListener:(NSData* _Nullable)senderID messageType:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * RemoveService removes all services for the given tag. */ @@ -1329,6 +1345,15 @@ object. - (BOOL)unsetAlternativeUserDiscovery:(NSError* _Nullable* _Nullable)error; @end +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedCode; +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedMessage; + /** * AsyncRequestRestLike sends an asynchronous restlike request to a given contact. @@ -1345,6 +1370,23 @@ of JSON marshalling the response when received. */ FOUNDATION_EXPORT BOOL BindingsAsyncRequestRestLike(long e2eID, NSData* _Nullable recipient, NSData* _Nullable request, NSData* _Nullable paramsJSON, id<BindingsRestlikeCallback> _Nullable cb, NSError* _Nullable* _Nullable error); +/** + * CreateUserFriendlyErrorMessage will convert the passed in error string +to an error string that is user-friendly if a substring match is +found to a common error. Common errors is a map which can be updated +using UpdateCommonErrors. If the error is not common, some simple parsing +is done on the error message to make it more user-accessible, removing +backend specific jargon. + +Parameters + - errStr - an error returned from the backend. + +Returns + - A user-friendly error message. This should be devoid of technical speak + but still be meaningful for front-end or back-end teams. + */ +FOUNDATION_EXPORT NSString* _Nonnull BindingsCreateUserFriendlyErrorMessage(NSString* _Nullable errStr); + /** * DownloadAndVerifySignedNdfWithUrl retrieves the NDF from a specified URL. The NDF is processed into a protobuf containing a signature that is verified @@ -1488,6 +1530,10 @@ FOUNDATION_EXPORT BindingsCmix* _Nullable BindingsLoadCmix(NSString* _Nullable s Parameters: - e2eID - e2e object ID in the tracker - follower - network follower func wrapped in UdNetworkStatus + - username - the username the user wants to register with UD. + If the user is already registered, this field may be blank + - registrationValidationSignature - the signature provided by the xx network. + This signature is optional for other consumers who deploy their own UD. */ FOUNDATION_EXPORT BindingsUserDiscovery* _Nullable BindingsLoadOrNewUserDiscovery(long e2eID, id<BindingsUdNetworkStatus> _Nullable follower, NSString* _Nullable username, NSData* _Nullable registrationValidationSignature, NSError* _Nullable* _Nullable error); @@ -1711,6 +1757,21 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); +/** + * UpdateCommonErrors updates the internal error mapping DB. This internal database +maps errors returned from the backend to user-friendly error messages. + +Parameters + - jsonFile - contents of a JSON file whose format conforms to the example below. +Example Input: + { + "Failed to Unmarshal Conversation": "Could not retrieve conversation", + "Failed to unmarshal SentRequestMap": "Failed to pull up friend requests", + "cannot create username when network is not health": "Cannot create username, unable to connect to network", + } + */ +FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, NSError* _Nullable* _Nullable error); + @class BindingsAuthCallbacks; @class BindingsBroadcastListener; diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings index 7463bb58b196e6187b4aee07f15acd218a1e7c6c..c3a97c15db2fd9ff9c08df5a2df1e9d276e783b7 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h index a56558d0ae166ee09f92bcb66c592ff5fae5c131..f625ef9e8b761631a702b1b07fc6dc56c78b229c 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h @@ -404,6 +404,11 @@ Parameters: * GetID returns the ID for this Cmix in the cmixTracker. */ - (long)getID; +/** + * GetReceptionRegistrationValidationSignature returns the signature provided by +the xx network. + */ +- (NSData* _Nullable)getReceptionRegistrationValidationSignature; /** * HasRunningProcessies checks if any background threads are running and returns true if one or more are. @@ -724,6 +729,17 @@ The first payload is index 0. * PayloadSize returns the max payload size for a partitionable E2E message. */ - (long)payloadSize; +/** + * RegisterListener registers a new listener. + +Parameters: + - senderId - the user ID who sends messages to this user that + this function will register a listener for. + - messageType - message type from the sender you want to listen for. + - newListener: A provider for a callback to hear a message. + Do not pass nil to this. + */ +- (BOOL)registerListener:(NSData* _Nullable)senderID messageType:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * RemoveService removes all services for the given tag. */ @@ -1329,6 +1345,15 @@ object. - (BOOL)unsetAlternativeUserDiscovery:(NSError* _Nullable* _Nullable)error; @end +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedCode; +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedMessage; + /** * AsyncRequestRestLike sends an asynchronous restlike request to a given contact. @@ -1345,6 +1370,23 @@ of JSON marshalling the response when received. */ FOUNDATION_EXPORT BOOL BindingsAsyncRequestRestLike(long e2eID, NSData* _Nullable recipient, NSData* _Nullable request, NSData* _Nullable paramsJSON, id<BindingsRestlikeCallback> _Nullable cb, NSError* _Nullable* _Nullable error); +/** + * CreateUserFriendlyErrorMessage will convert the passed in error string +to an error string that is user-friendly if a substring match is +found to a common error. Common errors is a map which can be updated +using UpdateCommonErrors. If the error is not common, some simple parsing +is done on the error message to make it more user-accessible, removing +backend specific jargon. + +Parameters + - errStr - an error returned from the backend. + +Returns + - A user-friendly error message. This should be devoid of technical speak + but still be meaningful for front-end or back-end teams. + */ +FOUNDATION_EXPORT NSString* _Nonnull BindingsCreateUserFriendlyErrorMessage(NSString* _Nullable errStr); + /** * DownloadAndVerifySignedNdfWithUrl retrieves the NDF from a specified URL. The NDF is processed into a protobuf containing a signature that is verified @@ -1488,6 +1530,10 @@ FOUNDATION_EXPORT BindingsCmix* _Nullable BindingsLoadCmix(NSString* _Nullable s Parameters: - e2eID - e2e object ID in the tracker - follower - network follower func wrapped in UdNetworkStatus + - username - the username the user wants to register with UD. + If the user is already registered, this field may be blank + - registrationValidationSignature - the signature provided by the xx network. + This signature is optional for other consumers who deploy their own UD. */ FOUNDATION_EXPORT BindingsUserDiscovery* _Nullable BindingsLoadOrNewUserDiscovery(long e2eID, id<BindingsUdNetworkStatus> _Nullable follower, NSString* _Nullable username, NSData* _Nullable registrationValidationSignature, NSError* _Nullable* _Nullable error); @@ -1711,6 +1757,21 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); +/** + * UpdateCommonErrors updates the internal error mapping DB. This internal database +maps errors returned from the backend to user-friendly error messages. + +Parameters + - jsonFile - contents of a JSON file whose format conforms to the example below. +Example Input: + { + "Failed to Unmarshal Conversation": "Could not retrieve conversation", + "Failed to unmarshal SentRequestMap": "Failed to pull up friend requests", + "cannot create username when network is not health": "Cannot create username, unable to connect to network", + } + */ +FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, NSError* _Nullable* _Nullable error); + @class BindingsAuthCallbacks; @class BindingsBroadcastListener; diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings index 7463bb58b196e6187b4aee07f15acd218a1e7c6c..c3a97c15db2fd9ff9c08df5a2df1e9d276e783b7 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h index a56558d0ae166ee09f92bcb66c592ff5fae5c131..f625ef9e8b761631a702b1b07fc6dc56c78b229c 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -404,6 +404,11 @@ Parameters: * GetID returns the ID for this Cmix in the cmixTracker. */ - (long)getID; +/** + * GetReceptionRegistrationValidationSignature returns the signature provided by +the xx network. + */ +- (NSData* _Nullable)getReceptionRegistrationValidationSignature; /** * HasRunningProcessies checks if any background threads are running and returns true if one or more are. @@ -724,6 +729,17 @@ The first payload is index 0. * PayloadSize returns the max payload size for a partitionable E2E message. */ - (long)payloadSize; +/** + * RegisterListener registers a new listener. + +Parameters: + - senderId - the user ID who sends messages to this user that + this function will register a listener for. + - messageType - message type from the sender you want to listen for. + - newListener: A provider for a callback to hear a message. + Do not pass nil to this. + */ +- (BOOL)registerListener:(NSData* _Nullable)senderID messageType:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * RemoveService removes all services for the given tag. */ @@ -1329,6 +1345,15 @@ object. - (BOOL)unsetAlternativeUserDiscovery:(NSError* _Nullable* _Nullable)error; @end +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedCode; +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedMessage; + /** * AsyncRequestRestLike sends an asynchronous restlike request to a given contact. @@ -1345,6 +1370,23 @@ of JSON marshalling the response when received. */ FOUNDATION_EXPORT BOOL BindingsAsyncRequestRestLike(long e2eID, NSData* _Nullable recipient, NSData* _Nullable request, NSData* _Nullable paramsJSON, id<BindingsRestlikeCallback> _Nullable cb, NSError* _Nullable* _Nullable error); +/** + * CreateUserFriendlyErrorMessage will convert the passed in error string +to an error string that is user-friendly if a substring match is +found to a common error. Common errors is a map which can be updated +using UpdateCommonErrors. If the error is not common, some simple parsing +is done on the error message to make it more user-accessible, removing +backend specific jargon. + +Parameters + - errStr - an error returned from the backend. + +Returns + - A user-friendly error message. This should be devoid of technical speak + but still be meaningful for front-end or back-end teams. + */ +FOUNDATION_EXPORT NSString* _Nonnull BindingsCreateUserFriendlyErrorMessage(NSString* _Nullable errStr); + /** * DownloadAndVerifySignedNdfWithUrl retrieves the NDF from a specified URL. The NDF is processed into a protobuf containing a signature that is verified @@ -1488,6 +1530,10 @@ FOUNDATION_EXPORT BindingsCmix* _Nullable BindingsLoadCmix(NSString* _Nullable s Parameters: - e2eID - e2e object ID in the tracker - follower - network follower func wrapped in UdNetworkStatus + - username - the username the user wants to register with UD. + If the user is already registered, this field may be blank + - registrationValidationSignature - the signature provided by the xx network. + This signature is optional for other consumers who deploy their own UD. */ FOUNDATION_EXPORT BindingsUserDiscovery* _Nullable BindingsLoadOrNewUserDiscovery(long e2eID, id<BindingsUdNetworkStatus> _Nullable follower, NSString* _Nullable username, NSData* _Nullable registrationValidationSignature, NSError* _Nullable* _Nullable error); @@ -1711,6 +1757,21 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); +/** + * UpdateCommonErrors updates the internal error mapping DB. This internal database +maps errors returned from the backend to user-friendly error messages. + +Parameters + - jsonFile - contents of a JSON file whose format conforms to the example below. +Example Input: + { + "Failed to Unmarshal Conversation": "Could not retrieve conversation", + "Failed to unmarshal SentRequestMap": "Failed to pull up friend requests", + "cannot create username when network is not health": "Cannot create username, unable to connect to network", + } + */ +FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, NSError* _Nullable* _Nullable error); + @class BindingsAuthCallbacks; @class BindingsBroadcastListener; diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings index 7463bb58b196e6187b4aee07f15acd218a1e7c6c..c3a97c15db2fd9ff9c08df5a2df1e9d276e783b7 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h index a56558d0ae166ee09f92bcb66c592ff5fae5c131..f625ef9e8b761631a702b1b07fc6dc56c78b229c 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h @@ -404,6 +404,11 @@ Parameters: * GetID returns the ID for this Cmix in the cmixTracker. */ - (long)getID; +/** + * GetReceptionRegistrationValidationSignature returns the signature provided by +the xx network. + */ +- (NSData* _Nullable)getReceptionRegistrationValidationSignature; /** * HasRunningProcessies checks if any background threads are running and returns true if one or more are. @@ -724,6 +729,17 @@ The first payload is index 0. * PayloadSize returns the max payload size for a partitionable E2E message. */ - (long)payloadSize; +/** + * RegisterListener registers a new listener. + +Parameters: + - senderId - the user ID who sends messages to this user that + this function will register a listener for. + - messageType - message type from the sender you want to listen for. + - newListener: A provider for a callback to hear a message. + Do not pass nil to this. + */ +- (BOOL)registerListener:(NSData* _Nullable)senderID messageType:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * RemoveService removes all services for the given tag. */ @@ -1329,6 +1345,15 @@ object. - (BOOL)unsetAlternativeUserDiscovery:(NSError* _Nullable* _Nullable)error; @end +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedCode; +/** + * Error codes + */ +FOUNDATION_EXPORT NSString* _Nonnull const BindingsUnrecognizedMessage; + /** * AsyncRequestRestLike sends an asynchronous restlike request to a given contact. @@ -1345,6 +1370,23 @@ of JSON marshalling the response when received. */ FOUNDATION_EXPORT BOOL BindingsAsyncRequestRestLike(long e2eID, NSData* _Nullable recipient, NSData* _Nullable request, NSData* _Nullable paramsJSON, id<BindingsRestlikeCallback> _Nullable cb, NSError* _Nullable* _Nullable error); +/** + * CreateUserFriendlyErrorMessage will convert the passed in error string +to an error string that is user-friendly if a substring match is +found to a common error. Common errors is a map which can be updated +using UpdateCommonErrors. If the error is not common, some simple parsing +is done on the error message to make it more user-accessible, removing +backend specific jargon. + +Parameters + - errStr - an error returned from the backend. + +Returns + - A user-friendly error message. This should be devoid of technical speak + but still be meaningful for front-end or back-end teams. + */ +FOUNDATION_EXPORT NSString* _Nonnull BindingsCreateUserFriendlyErrorMessage(NSString* _Nullable errStr); + /** * DownloadAndVerifySignedNdfWithUrl retrieves the NDF from a specified URL. The NDF is processed into a protobuf containing a signature that is verified @@ -1488,6 +1530,10 @@ FOUNDATION_EXPORT BindingsCmix* _Nullable BindingsLoadCmix(NSString* _Nullable s Parameters: - e2eID - e2e object ID in the tracker - follower - network follower func wrapped in UdNetworkStatus + - username - the username the user wants to register with UD. + If the user is already registered, this field may be blank + - registrationValidationSignature - the signature provided by the xx network. + This signature is optional for other consumers who deploy their own UD. */ FOUNDATION_EXPORT BindingsUserDiscovery* _Nullable BindingsLoadOrNewUserDiscovery(long e2eID, id<BindingsUdNetworkStatus> _Nullable follower, NSString* _Nullable username, NSData* _Nullable registrationValidationSignature, NSError* _Nullable* _Nullable error); @@ -1711,6 +1757,21 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); +/** + * UpdateCommonErrors updates the internal error mapping DB. This internal database +maps errors returned from the backend to user-friendly error messages. + +Parameters + - jsonFile - contents of a JSON file whose format conforms to the example below. +Example Input: + { + "Failed to Unmarshal Conversation": "Could not retrieve conversation", + "Failed to unmarshal SentRequestMap": "Failed to pull up friend requests", + "cannot create username when network is not health": "Cannot create username, unable to connect to network", + } + */ +FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, NSError* _Nullable* _Nullable error); + @class BindingsAuthCallbacks; @class BindingsBroadcastListener;