cubeacon / android-cubeacon-sample

Android Cubeacon Sample Project
12 stars 10 forks source link

determine beacon #4

Closed andra17 closed 9 years ago

andra17 commented 9 years ago

i want to create two custom different campaign(campaign A & B) with two beacon in the same event(on Near) so went entering on near area of beacon B, it showing campaign campaign B and when entering on Near area A it showing campaign A, how can i do that?

Best Regards,

alann-maulana commented 9 years ago

Hi @andra17 ,

You can do this by logging into Cubeacon Developer Page -> Your Apps -> Storyline Menu. Then, create your multiple campaign using multiple beacons here. For example, I have setup some storyline like this screenshoot.

Best Regards.

andra17 commented 9 years ago

thats for the default campaign that available on the cubeacon developer page, i mean ,if i want to create my default campaign such as opening login page,so beacon A open a login page and beacon B do something else , what should i do?

Best Regards.

alann-maulana commented 9 years ago

Hi @andra17

Just like issue #3 you can provide a storyline with Near event, disable all campaign days and then add your custom code to the callback function of onNearBeacon

    @Override
    protected void onNearBeacon(CBBeacon beacon) {
        // TODO: when the beacon proximity are near
        // for example showing login activity when beacon with UUID: a, Major: b, Minor: c
        if (beacon.getProximityUUID().equals(a)
            && beacon.getMajor() == b
            && beacon.getMinor() == c) {
            Intent intent = new Intent(this, LoginActivity.class);
            startActivity(intent);
        } else {
            // do something else
        }
    }

For a complete references about Android Cubeacon SDK API Documentation, you can visit this page

Best Regards.

andra17 commented 9 years ago

ooh okey got it thank you very much, so helpful for beginner :)

best regards,

alann-maulana commented 9 years ago

OK @andra17 you're welcome.