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-12-07 18:24:54 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
60f82088b31ab36a656830527a8ec2cc12357f43
60f82088
1 parent
78a44d90
crash 1 possible fix
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
60f8208
...
...
@@ -4872,13 +4872,36 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)
// }
[
_httpClient
.
requestSerializer
setValue
:[
@"Bearer "
stringByAppendingString
:
accessToken
]
forHTTPHeaderField
:
@"Authorization"
];
}
NSString
*
loyaltyDate
=
@""
;
NSString
*
loyaltySignature
=
@""
;
NSString
*
bundleId
=
@""
;
@try
{
loyaltyDate
=
[
NSString
stringWithFormat
:
@"%lu"
,
timestamp
];
loyaltySignature
=
[[
NSString
stringWithFormat
:
@"%@%lu"
,
_apiKey
,
timestamp
]
SHA256Sum
];
bundleId
=
[
NSString
stringWithFormat
:
@"ios:%@"
,
[[
NSBundle
mainBundle
]
objectForInfoDictionaryKey
:
@"CFBundleIdentifier"
]];
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"HTTPHeaders error: %@"
,
exception
.
reason
);
if
(
failureBlock
)
{
NSError
*
error
=
nil
;
failureBlock
(
error
);
}
}
@finally
{
// NSLog(@"Finally condition");
}
[
_httpClient
.
requestSerializer
setValue
:
_webId
forHTTPHeaderField
:
@"loyalty-web-id"
];
[
_httpClient
.
requestSerializer
setValue
:[
NSString
stringWithFormat
:
@"%lu"
,
timestamp
]
forHTTPHeaderField
:
@"loyalty-date"
];
[
_httpClient
.
requestSerializer
setValue
:[[
NSString
stringWithFormat
:
@"%@%lu"
,
_apiKey
,
timestamp
]
SHA256Sum
]
forHTTPHeaderField
:
@"loyalty-signature"
];
// [_httpClient.requestSerializer setValue:[NSString stringWithFormat:@"%lu", timestamp] forHTTPHeaderField:@"loyalty-date"];
// [_httpClient.requestSerializer setValue:[[NSString stringWithFormat:@"%@%lu", _apiKey, timestamp] SHA256Sum] forHTTPHeaderField:@"loyalty-signature"];
[
_httpClient
.
requestSerializer
setValue
:
loyaltyDate
forHTTPHeaderField
:
@"loyalty-date"
];
[
_httpClient
.
requestSerializer
setValue
:
loyaltySignature
forHTTPHeaderField
:
@"loyalty-signature"
];
[
_httpClient
.
requestSerializer
setValue
:
@"gzip"
forHTTPHeaderField
:
@"Accept-Encoding"
];
[
_httpClient
.
requestSerializer
setValue
:
@"application/json"
forHTTPHeaderField
:
@"Accept"
];
[
_httpClient
.
requestSerializer
setValue
:
@"gzip"
forHTTPHeaderField
:
@"User-Agent"
];
[
_httpClient
.
requestSerializer
setValue
:[
NSString
stringWithFormat
:
@"ios:%@"
,
[[
NSBundle
mainBundle
]
objectForInfoDictionaryKey
:
@"CFBundleIdentifier"
]]
forHTTPHeaderField
:
@"loyalty-bundle-id"
];
// [_httpClient.requestSerializer setValue:[NSString stringWithFormat:@"ios:%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"]]
[
_httpClient
.
requestSerializer
setValue
:
bundleId
forHTTPHeaderField
:
@"loyalty-bundle-id"
];
[
_httpClient
.
requestSerializer
setValue
:[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
]
forHTTPHeaderField
:
@"unique-device-id"
];
[
_httpClient
.
requestSerializer
setValue
:
@"apple"
forHTTPHeaderField
:
@"vendor"
];
[
_httpClient
.
requestSerializer
setValue
:
@"platform"
forHTTPHeaderField
:
@"ios"
];
...
...
Please
register
or
login
to post a comment