Configuration

In the react native app, initialization component, import the following library on top of the page

Copy

import {MagicPixel} from '@magicpixel/rn-mp-client-sdk';

In the constructor of the entry component, configure the MagicPixel sdk as below

Copy

try {
    MagicPixel.init({
        orgId: '<ENTER VENDOR ID SHARED BY MAGIC PIXEL>',
        projectId: '<ENTER PROJECT ID SHARED BY MAGIC PIXEL>',
        env: 'production',
        baseUrl: 'https://sdk-mt.magicpixel.io',
        device_type: '<mobile | tablet>',
        logLevel: '<none | debug | warn | error>' // optional field
    }).then(() => {
        MagicPixel.ready();
    }).catch(err => {
        console.log(err);
        // report to firebase analytics or print to console here for tracking
    });

} catch (err) {
 // report to firebase analytics or print to console here for tracking
}

Copy

PreviousInstallation NextDisplay Debug Id

Last updated 1 year ago