hydrasdk-demo-android icon indicating copy to clipboard operation
hydrasdk-demo-android copied to clipboard

Couldn't connect after initializing SDK with premium carrierID

Open abrusdev opened this issue 3 years ago • 9 comments

Good day.

val id = if (isSub)
            BuildConfig.PREM_CARRIER_ID
        else
            BuildConfig.BASE_CARRIER_ID

log("rem id $id")

initSdk(id)
initHydraSdk()
if (isLogin())
    logOut()

loginToVpn()

Everything working fine until user buy the subscription and after payment, I am initializing SDK again, but it is giving an exception - Canceled VPN stop

Another interesting point is when I initializing with premium carrierID in debug mode, everything working fine, but after releasing app it is not possible to connect VPN with premium carrierID, only limited carrierID works.

abrusdev avatar Jun 09 '21 12:06 abrusdev

  1. what is the reason to have different carrier for premium user?
  2. You can initialize 2 instances of sdk with UnifiedSDK.getInstance(name), with different carriers
  3. You have canceled VPN stop in what call?
  4. are you stopping vpn before reinitialization?
  5. please share logs (adb logcat without any filter)

timoshenkoav avatar Jun 09 '21 12:06 timoshenkoav

  1. because origin carrier ID gives 50 daily limit, premiumCarrierID gives unlimited connection
  2. Even I have tried to clear instances with UnifiedSdk.clearInstances() before initializing second carrier ID
  3. While connecting to VPN.
  4. No

abrusdev avatar Jun 10 '21 04:06 abrusdev

  1. what carrier gives you unlimited connection?
  2. You should do this when in idle state - so stop VPN before reinitialising the sdk

timoshenkoav avatar Jun 10 '21 08:06 timoshenkoav

  1. yes with another carrier ID, there wouldn't have daily limit ( 50mb )
  2. After user bought subscribtion, I have disconnecting,stoping and logOut from SDK, then reInitialize SDK with new carrier ID, but second time it is not connecting...

abrusdev avatar Jun 10 '21 15:06 abrusdev

image I have determined that, your SDK initializing our carrierID, but this carrier ID must work without any limit, namely RemainingTraffic.isUnlimited must response us true, but it is not responsing.

instead it is calculating remaining traffic (onTrafficUpdate) image

abrusdev avatar Jun 10 '21 16:06 abrusdev

Another interesting aspect is that, in debug mode, everything works fine, only in release it is causing such problems

abrusdev avatar Jun 10 '21 16:06 abrusdev

Traffic is calculating and updating locally - its not related to traffic limits or carrier - its just local information. Some time ago we've updated carriers to have daily limit - to have unlimited users you have to integrate subscription reporting with API and dashboard. Maybe in release builds your code is "optimized" in any wrong case

timoshenkoav avatar Jun 10 '21 17:06 timoshenkoav

Is that possible? What if working at DEBUG doesn’t work at RELEASE?

abrusdev avatar Jun 10 '21 20:06 abrusdev

can you create simple app that reproduces your issue and share with me? or change this demo app to reproduce the issue?

timoshenkoav avatar Jun 10 '21 21:06 timoshenkoav