diff --git a/Sources/mParticle-Appboy/MPKitAppboy.m b/Sources/mParticle-Appboy/MPKitAppboy.m index 8205a8b..5225fd5 100644 --- a/Sources/mParticle-Appboy/MPKitAppboy.m +++ b/Sources/mParticle-Appboy/MPKitAppboy.m @@ -377,6 +377,9 @@ - (void)start { [self->appboyInstance setInAppMessagePresenter:inAppMessageUI]; #endif + FilteredMParticleUser *currentUser = [[self kitApi] getCurrentUserWithKit:self]; + [self updateUser:currentUser request:currentUser.userIdentities]; + self->_started = YES; dispatch_async(dispatch_get_main_queue(), ^{ @@ -818,26 +821,26 @@ - (nonnull MPKitExecStatus *)setUserAttribute:(nonnull NSString *)key values:(no } - (nonnull MPKitExecStatus *)onIdentifyComplete:(FilteredMParticleUser *)user request:(FilteredMPIdentityApiRequest *)request { - return [self updateUser:user request:request]; + return [self updateUser:user request:request.userIdentities]; } - (nonnull MPKitExecStatus *)onLoginComplete:(FilteredMParticleUser *)user request:(FilteredMPIdentityApiRequest *)request { - return [self updateUser:user request:request]; + return [self updateUser:user request:request.userIdentities]; } - (nonnull MPKitExecStatus *)onLogoutComplete:(FilteredMParticleUser *)user request:(FilteredMPIdentityApiRequest *)request { - return [self updateUser:user request:request]; + return [self updateUser:user request:request.userIdentities]; } - (nonnull MPKitExecStatus *)onModifyComplete:(FilteredMParticleUser *)user request:(FilteredMPIdentityApiRequest *)request { - return [self updateUser:user request:request]; + return [self updateUser:user request:request.userIdentities]; } -- (nonnull MPKitExecStatus *)updateUser:(FilteredMParticleUser *)user request:(FilteredMPIdentityApiRequest *)request { +- (nonnull MPKitExecStatus *)updateUser:(FilteredMParticleUser *)user request:(NSDictionary *)userIdentities { MPKitExecStatus *execStatus = nil; - if (request.userIdentities) { - NSMutableDictionary *userIDsCopy = [request.userIdentities copy]; + if (userIdentities) { + NSMutableDictionary *userIDsCopy = [userIdentities copy]; NSString *userId; if (_configuration[userIdTypeKey]) {