Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MParticle forward setLocation selector to Braze (Appboy) which is not supported #260

Open
menasameh opened this issue Mar 4, 2024 · 0 comments

Comments

@menasameh
Copy link

I was getting those 2 messages in the console

mParticle -> Forwarded selector: setLocation: is not supported by this kit
mParticle -> Failed to Forward to Kit

And after some investigation, According to this block of code

- (void)setLocation:(CLLocation *)location {
    if (![[MParticle sharedInstance].stateMachine.location isEqual:location]) {
        [MParticle sharedInstance].stateMachine.location = location;
        MPILogDebug(@"Set location %@", location);
        
        dispatch_async(dispatch_get_main_queue(), ^{
            [MPListenerController.sharedInstance onAPICalled:_cmd parameter1:location];
            
            // Forwarding calls to kits
            MPForwardQueueParameters *queueParameters = [[MPForwardQueueParameters alloc] init];
            [queueParameters addParameter:location];
            
            [[MParticle sharedInstance].kitContainer forwardSDKCall:_cmd
                                                              event:nil
                                                         parameters:queueParameters
                                                        messageType:MPMessageTypeEvent
                                                           userInfo:nil
             ];
        });
    }
}

When we provide a new location it will loop through the activeKitsRegistry and try to forward the message to each active kit, however for Braze (Appboy) the setLocation selector is not supported, that's why I'm getting these messages in the console.

we should use one of those two instead

[AppDelegate.braze.user setLastKnownLocationWithLatitude:latitude
                                               longitude:longitude
                                      horizontalAccuracy:horizontalAccuracy];
[AppDelegate.braze.user setLastKnownLocationWithLatitude:latitude
                                               longitude:longitude
                                      horizontalAccuracy:horizontalAccuracy
                                                altitude:altitude
                                        verticalAccuracy:verticalAccuracy];

According to Braze (Appboy) docs

So I have 2 questions

  • Does that mean that currently we don't provide location to Braze (Appboy)?
  • Could that be solved on your side by converting the selector setLocation to setLastKnownLocationWithLatitude?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant