Conditionally loading the Kik SDK

107 views Asked by At

I want to enable my mobile site as a Kik app but I wont to avoid loading the Kik JS SDK for the rest of the world. Looking at Kik's user agent there seems to be no mention of Kik.

2

There are 2 answers

0
jairajs89 On

The kik.js can be loaded in any environment but most functionality can only used inside the Kik browser. The common way of segmenting behaviour in and out of Kik is the following:

if (kik.enabled) {
    // inside kik
} else {
    // outside kik
}

So I would suggest just leaving the kik.js script in all the time and coding different behaviours in JavaScript.

0
DevBrad On

You could redirect all non-kik browsers to a separate page.