HomeDocumentationAPI Reference
Getting StartedAPI ReferenceHelp CenterVideo Tours

Set Floating Button Position

If you're using the floating button as your primary invocation method, you can set a position for it to show up by default.

There are two variables here that can be manipulated:

  • floatingButtonEdge: Which edge of the screen to show the button
  • floatingButtonTopOffset: The position of the button on the y-axis
Edge

BugReporting.floatingButtonEdge = .maxXEdge
IBGBugReporting.floatingButtonEdge = CGRectMaxXEdge;
BugReporting.setFloatingButtonEdge(InstabugFloatingButtonEdge.RIGHT);
//iOS
Instabug.setFloatingButtonEdge(Instabug.floatingButtonEdge.right, 250);

//Android
new RNInstabugReactnativePackage.Builder("TOKEN",MainApplication.this)
                            .setInvocationEvent("shake")
                            .setPrimaryColor("#1D82DC")
                            .setFloatingEdge("left")
                            .build()
//iOS
//Can be changed through the activate method
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
       floatingButtonEdge:'left',  //Values: left, right. Default:    'right'
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

//Android
//Builder method generated in MyApplication class
new Instabug.Builder(this, "APP_TOKEN")
    .setInvocationEvent(InstabugInvocationEvent.SHAKE)
  .setFloatingButtonEdge(InstabugFloatingButtonEdge.LEFT)
    .build();
//iOS
IBGBugReporting.FloatingButtonEdge = CoreGraphics.CGRectEdge.MaxXEdge;

//Android
new Instabug.Builder(this, "YOUR_ANDROID_TOKEN")
    .SetInvocationEvent(InstabugInvocationEvent.Shake)
    .SetFloatingButtonEdge(IBGFloatingButtonEdge.Left)
    .Build();
Top Offset

BugReporting.floatingButtonTopOffset = 48
IBGBugReporting.floatingButtonTopOffset = 48;
BugReporting.setFloatingButtonOffset(50);
//iOS
Instabug.setFloatingButtonEdge(140)

//Android
new RNInstabugReactnativePackage.Builder("TOKEN",MainApplication.this)
                            .setInvocationEvent("shake")
                            .setPrimaryColor("#1D82DC")
                            .setFloatingButtonOffsetFromTop(250)
                            .build()
//iOS
//Can be changed through the activate method
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
       floatingButtonOffset: 2     //Default value: -1
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

//Android 
//Builder method generated in MyApplication class
new Instabug.Builder(this, "APP_TOKEN")
    .setInvocationEvent(InstabugInvocationEvent.SHAKE)
  .setFloatingButtonOffsetFromTop(50);
    .build();
//iOS
IBGBugReporting.FloatingButtonTopOffset = 10;

//Android
BugReporting.SetFloatingButtonOffset(50);