My setup works fine for many other filters, but for some reason I’m not able to get anything to draw onscreen as a result of the touch. The effect works fine in DeepAR Studio live preview, and I’ve confirmed that touch events are being passed through the React Native wrapper to the underlying DeepAR SDK, but then nothing happens.
I recognize the React Native library I’m using is community supported and detailed help may not be available, so I’m interested more in tips about how I might debug this issue rather than an actual solution. If touch events are being sent to the SDK and the effect is being loaded correctly, what else can I check? Are there debug options within the effect script that I could use to verify behavior somehow? I see I can output debug logs in DeepAR Studio, but I’m not sure that’s intended to work when deployed in my app as well.
You can try using scripting to trigger an event on touch DeepAR Scripting API: Home, but my best guess is that the touches aren’t being sent to the SDK in a way it can read them
Thanks for the ideas. Can you elaborate on “touches aren’t being sent to the SDK in a way it can read them”? How would I debug that? The code for sending touches looks fine to me at a glance but I’m not an expert in what the SDK expects
Any other thoughts you can offer on this? Looking at the DeepAR tutorial repo for the face paint demo the code looks identical to the react-native-deepar library I’m using (see previous link):
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if(event.type == UIEventTypeTouches) {
UITouch * touch = [touches allObjects][0];
CGPoint point = [self getPoint:touch];
TouchInfo info = {point.x, point.y, START};
[self.deepar touchOccurred:info];
} else {
[super touchesBegan:touches withEvent:event];
}
}
// Called every time a change in the previously started touch is detected
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
if(event.type == UIEventTypeTouches) {
UITouch * touch = [touches allObjects][0];
CGPoint point = [self getPoint:touch];
TouchInfo info = {point.x, point.y, MOVE};
[self.deepar touchOccurred:info];
} else {
[super touchesMoved:touches withEvent:event];
}
}
// Called every time a previously started touch is ended
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
if(event.type == UIEventTypeTouches) {
UITouch * touch = [touches allObjects][0];
CGPoint point = [self getPoint:touch];
TouchInfo info = {point.x, point.y, END};
[self.deepar touchOccurred:info];
} else {
[super touchesEnded:touches withEvent:event];
}
}
Yep, touches seem to be coming through into the view just fine. I added logging in the react-native-deepar lib around the touchOccurred DeepAR SDK call and I do see it’s logging touches with plausibly correct coordinates:
Is there any way I can get visibility into what’s happening in DeepAR between this touchOccurred call and the onTouchOccurred function in my effect script? As far as I can tell, DeepAR is being called with the touch using code that follows the previously linked example, but onTouchOccurred isn’t firing.
Full logging code for reference (same pattern applies to MOVE and END):