GleapSDK / ReactNative-SDK

Other
13 stars 5 forks source link

Add dev mode #2

Closed itajenglish closed 2 years ago

itajenglish commented 2 years ago

Add ability to disable gleap from showing widget when opening React Native debugger menu.

https://user-images.githubusercontent.com/889564/159640386-ea7635c0-75a1-4b1f-bb49-4cb59a2d0ff9.mp4

niklasfessler commented 2 years ago

Dear @itajenglish,

thanks for your feedback. We're going to check that internal and let you know :)

Greetings Niklas

boehlerlukas commented 2 years ago

Hey @itajenglish ,

thanks for your message! You could disable the Shake method in our widget configurator and enable it manually depending on the environment with the setActivationMethods function (https://gleap.io/docs/reactnative/activation-methods).

The code could look something like this:

if (__DEV__) {
Gleap.setActivationMethods(['SCREENSHOT']);
} else {
Gleap.setActivationMethods(['SCREENSHOT', 'SHAKE']);
}

Let me know if this helps! Happy to have another look otherwise :)

itajenglish commented 2 years ago

Thank you @niklasfessler Hi @boehlerlukas, So I did try this and I don't think it worked. I'll try again! Maybe the SDK didn't update.

boehlerlukas commented 2 years ago

@itajenglish you are welcome! Please make sure that you also update the native dependencies with pod install as the native update is required for this to work. Let me know if it still doesn't work, happy to debug into this :)

itajenglish commented 2 years ago

FYI: I found pressing the esc key after it opens, prevents it from opening again until the app is closed and restarted in the simulator.

Not sure if it's a bug or a feature 😭

boehlerlukas commented 2 years ago

Great catch @itajenglish! Is this related to the RN SDK or to the JS SDK? I don't have an ESC button on my phone, so it might be related to the simulator? Happy to open another issue for this :)

itajenglish commented 2 years ago

RN SDK, When testing using the iOS simulator.


OS: iOS 15.4 Device: iPhone 13 Gleap SDK Version: 6.4.4

boehlerlukas commented 2 years ago

Thank you so much! We will have a look into this today. Will keep you posted!

itajenglish commented 2 years ago

@itajenglish you are welcome! Please make sure that you also update the native dependencies with pod install as the native update is required for this to work. Let me know if it still doesn't work, happy to debug into this :)

Still experiencing the same issue.

boehlerlukas commented 2 years ago

@itajenglish thanks for the update! We will have another look right tomorrow morning.

itajenglish commented 2 years ago

@boehlerlukas Did you have a chance to look into this?

boehlerlukas commented 2 years ago

@itajenglish sorry for the delay and thanks for the ping :) We could reproduce the issue. A fix will be available today.

boehlerlukas commented 2 years ago

Hey @itajenglish :)

react-native-gleapsdk@6.4.8 should now finally fix both issues. Please not that you also need to run pod update. Let me know if the fix works for you as well.

itajenglish commented 2 years ago

@boehlerlukas Awesome! Thanks for the update!