Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-10-27 15:46:37 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5111b74e489b36e9bf507d938cbbac995992dbbf
5111b74e
1 parent
feb24dc0
possible fix for initialize crash
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
5111b74
...
...
@@ -241,12 +241,29 @@ typedef void (^FailureResponse)(NSURLSessionDataTask * _Nullable task, NSError *
[
self
createDBIfNeeded
];
[
self
initDBIfNeeded
];
[
self
restore
];
// [self restore];
@try
{
[
self
restore
];
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"restore error: %@"
,
exception
.
reason
);
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
self
.
appUUID
=
[
defaults
stringForKey
:
@"NBAPPUuidUD"
];
self
.
apiKey
=
[
defaults
stringForKey
:
@"NBAPIKeyUD"
];
self
.
webId
=
[
defaults
stringForKey
:
@"NBWebIDUD"
];
}
@finally
{
// NSLog(@"Finally condition");
}
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
if
([
_appUUID
isEqualToString
:
appUUID
]
==
NO
)
{
self
.
appUUID
=
appUUID
;
self
.
apiKey
=
nil
;
self
.
webId
=
nil
;
[
defaults
setObject
:
appUUID
forKey
:
@"NBAPPUuidUD"
];
[
defaults
setBool
:
YES
forKey
:
@"NBAPPUuidChanged"
];
}
else
[
defaults
setBool
:
NO
forKey
:
@"NBAPPUuidChanged"
];
...
...
@@ -5677,6 +5694,11 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)
self
.
apiKey
=
[
context
valueForKey
:
@"api_key"
];
self
.
webId
=
[
context
valueForKey
:
@"web_id"
];
[
WLKeychain
setString
:[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
]
forKey
:
@"old_identifier_for_vendor"
];
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:[
context
valueForKey
:
@"api_key"
]
forKey
:
@"NBAPIKeyUD"
];
[
defaults
setObject
:[
context
valueForKey
:
@"web_id"
]
forKey
:
@"NBWebIDUD"
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
[
_pendingOperationsQueue
setSuspended
:
!
[
self
isRegistrationValid
]];
if
(
success
)
{
...
...
Please
register
or
login
to post a comment