Smartling / android-repository

Maven repository for binary Android SDKs
5 stars 1 forks source link

onStringsLoaded is never called, am I missing something? #10

Closed aphexcx closed 6 years ago

aphexcx commented 7 years ago

Here's my launch activity:

class LaunchActivity : BasePostmateActivity(), OTAListener {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.launch_activity)
    }

    override fun onStringsLoaded() {
        logE("STRINGS LOADED!!!!")
    }
}

That log line is never shown, and a breakpoint set on it never hits. Did I forget to configure something? Here's my smartling block from my gradle file:

smartling {
    projectId = "b7c533052"
    mode = "ota-serving"
    logLevel = "verbose"
    otaServing {
        projectSecret = "JOa0*snip*oxow=="
    }
    auth {
        userIdentifier = "kazw*snip*xyam"
        userSecret = "6uva*snip*hotj"
    }
    buildVariants {
        fastDevDebug {
//            mode = "context-capture"
            mode = "ota-serving"
        }
        slowMarketRelease {
            mode = "ota-serving"
        }
    }
}

As you can see, I made sure that the mode is set to ota-serving on all variants. I'm building the fastDevDebug variant.

foo4u commented 7 years ago

@aphexcx just to confirm this is for MDN and not context capture, right?

foo4u commented 7 years ago

If you are using Instant Run could you please disable it and try again?

aphexcx commented 7 years ago

Instant run is disabled; I'm trying to test the ota string serving. I changed a string on the smartling platform, set the mode to ota-serving as you can see above, and built. I expected the app to load with the new strings, but the onStringsLoaded method is never even getting called.

foo4u commented 7 years ago

For the changes to show up quickly, the file has to be fully published. As far as why your onStringsLoaded function isn't called, I'm going to research.

andriipanasiuk commented 7 years ago

@aphexcx Hey, sorry for the delay. I tried the sample project with Kotlin used as it's in your example and it's working fine. Do you see other logs with SmartlingSDK tag in you LogCat? Like this D/SmartlingSdk: Pull OTA for es using locale es or D/SmartlingSdk: Downloading production strings from: https://mdn-cdn.smartling.com/... or some others? What locale is set on the device you're running?