Skip to content

Commit

Permalink
fix: Identify API call using CNAME domain (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
einsteinx2 committed Jan 23, 2023
1 parent d116872 commit 0aae9af
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mParticle-Apple-SDK/Network/MPNetworkCommunication.m
Original file line number Diff line number Diff line change
Expand Up @@ -771,18 +771,24 @@ - (void)identityApiRequestWithURL:(NSURL*)url identityRequest:(MPIdentityHTTPBas

MPILogVerbose(@"Identity request:\nURL: %@ \nBody:%@", url, jsonRequest);

MPEndpoint endpointType = MPEndpointIdentityModify;
MPEndpoint endpointType;
MPURL *mpURL;
if ([self.identifyURL.url.absoluteString isEqualToString:url.absoluteString]) {
endpointType = MPEndpointIdentityIdentify;
mpURL = self.identifyURL;
} else if ([self.loginURL.url.absoluteString isEqualToString:url.absoluteString ]) {
endpointType = MPEndpointIdentityLogin;
mpURL = self.loginURL;
} else if ([self.logoutURL.url.absoluteString isEqualToString:url.absoluteString]) {
endpointType = MPEndpointIdentityLogout;
mpURL = self.logoutURL;
} else {
endpointType = MPEndpointIdentityModify;
mpURL = self.modifyURL;
}
[MPListenerController.sharedInstance onNetworkRequestStarted:endpointType url:url.absoluteString body:data];

NSObject<MPConnectorProtocol> *connector = [self makeConnector];
MPURL *mpURL = [[MPURL alloc] initWithURL:url defaultURL:url];
NSObject<MPConnectorResponseProtocol> *response = [connector responseFromPostRequestToURL:mpURL
message:nil
serializedParams:data];
Expand Down

0 comments on commit 0aae9af

Please sign in to comment.