'Subscribe failed exception : name = SUPPersistenceException description = 0 (OK)' during new registration
I'm working on iphone native app with SUP 2.1.3. We are getting the SUPPersistanceException while subscribing the local db with SCC. This is occurring only during the new registration of the iphone native app in SUP 2.1.3 in SCC.
I'm doing the following steps for sup connection on click of loginButton:
- Setup NSNotification observers
- Get the SupApplication instance and set the appIdentifier and callback handler.
- Register the callback handler instance to db class: [SUPDB registerCallbackHandler:callback];
- Update the connectionProperties of SUPApplication. (serverName, port, urlSuffix, farmid, loginCredentials, httpCredentials)
- Get the SupVault, unlock it and get the key (if exists).
- If database exists--> a) Get the key from the vault b) [[SUPDB connectionProfile] setEncryptionkey:key]; c) clean the SUPDB
- If database does not exists--> a) [SUPDB createDatabase] b) [SUPDB generateEncryptionKey] c) [SUPDB closeConnection] d) update the key into vault and lock vault.
- Set the SupApplication instance to dbclass. [SUPDB setApplication:app];
- Call registerApplication. [app registerApplication:TIME_OUT];
- When the registration/connection success notification triggers i'm updating the database synchronizationProfile. (username, password, servername, portnumber, domainNumber, networkProtocol, networkStreamParameters).
- Then calling the [SUPDB subscribe]; causes SUPPersistanceException. @catch issues [app stopConnection];
When repeating the above steps, step-6c causing the SUPPersistanceException (while cleaning the database).
In both the cases the error description of SUPPersistanceException is : "0 (OK)".
If I quit the application from the memory and run it again, it runs normally and fetches data from sup. I can only repeat the problem on first launch of app from device/simulator. (not everytime)
Please suggest a solution for the above problem. let me know if you need more information.
Thanks in advance.
We are using SUP 2.1.3 using RBS to fetch data from SUP. I realized that subscribe is part of MBS and should not be used in RBS procedure. we commented the [db subscribe], since then app is working fine.