Closed andra17 closed 9 years ago
and if i want to create my custom activty of the beacon ,e.g when entering beacon the app showing a table, where i should put the code in the eclipse project?
best regard
Hi @andra17,
I hope you already read about how to setup Cubeacon SDK Installation. If yes, there is some step you need to check :
Beacons Menu
, that your beacon parameters like UUID, major and minor value are correct.Storyline Menu
, that you have a story with event onEnter
and onExit
. Don't forget to enable the storyline by switching to ON
. @Override
protected void onBeaconExited(CBBeacon beacon, long timeInterval) {
// do something when beacon exited region
}
@Override
protected void onBeaconEntered(CBBeacon beacon) {
// do something when beacon entered region
}
Best Regards.
so if i want to make my own custom campaign i have to put my code on protected void onBeaconExited(....){
} cmiiw
best regards,
okey, if i disable the campaign's day, can i still receive the background notification? or i have to code it by myself?
best regards,
Hi @andra17,
If you want disable the campaign's day, it will just disable the existing storyline campaign provided by Cubeacon SDK. But you can still received the background callback function like onBeaconEntered and onBeaconExited. Some example code, showing a notification when entering beacon's region :
@Override
protected void onBeaconEntered(CBBeacon beacon) {
// showing notification when entering region of a beacon
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher) // notification icon
.setContentTitle("Cubeacon background notification") // title for notification
.setContentText("You have entering region of a beacon...") // message for notification
.setAutoCancel(true); // clear notification after click
Intent intent = new Intent(this, BeaconActivity.class);
PendingIntent pi = PendingIntent.getActivity(this,0,intent,Intent.FLAG_ACTIVITY_NEW_TASK);
mBuilder.setContentIntent(pi);
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(0, mBuilder.build());
}
Best Regards.
okey thank you very much ,work perfectly
Best Regard,
OK @andra17, we will close this issue. Please open a new issue if you have another question. Thanks.
Best Regards.
i tried to make the same app with the code from the video of demoapp but, my background notification like entering beacon and exitting beacon can't show up ,how can i fix it?
best regard,