SocialInviter
  • Get started
  • Change logs
  • REST APIs
    • 1️Authentication APIs (3)
    • 2️Address Book API
    • 3️Get User API
    • 4️Send Message API
    • 5️Post Content API
  • CONFIGURE SERVICES
    • ⭐Setup Google Yahoo etc..
  • Address Book Plugin
    • 1️Plugin Setup
    • 2️Service buttons
    • 3️Customize look & feel
    • 4️Methods & Options
    • 5️Localize content
    • 6️Callbacks
  • Others
    • Supported Services
    • Error Handling
Powered by GitBook
On this page
  • List of available callbacks:
  • 1. Imported callback
  • 2. Connect callback
  • 3. Proceed callback
  • 4. Send callback
  • 5. Service invite button callback
  • 6. Full example

Was this helpful?

  1. Address Book Plugin

Callbacks

PreviousLocalize contentNextSupported Services

Last updated 1 year ago

Was this helpful?

List of available callbacks:

1. Imported callback

This callback will be executed after the contacts are imported.

SocialInviter.set({
    authUrl: {
        development: 'http://127.0.0.1:5501/oauth.html',
        stage: 'https://stage.yourdomain.com/oauth.html',
    },
    style: {
        'font-family': 'Arial'
    },
    callbacks: {
        imported: (service, profile, addressbook) => {
            console.log('service', service);
            console.log('addressbook', addressbook);
        }
    }
});

2. Connect callback

SocialInviter.set({
    authUrl: {
        development: 'http://127.0.0.1:5501/oauth.html',
        stage: 'https://stage.yourdomain.com/oauth.html',
    },
    style: {
        'font-family': 'Arial'
    },
    callbacks: {
        connect: (service, profile) => {
            if (service === "email") {
                // Your logic here for continue button click
                console.log(service, profile.email);
            } else {
                // Your logic here
            }
        }
    }
});

3. Proceed callback

This callback will be executed once a user clicks on the "Proceed" button on the contacts screen

SocialInviter.set({
    authUrl: {
        development: 'http://127.0.0.1:5501/oauth.html',
        stage: 'https://stage.yourdomain.com/oauth.html',
    },
    style: {
        'font-family': 'Arial'
    },
    callbacks: {
        proceed: (service, profile, addressbook, selected) => {
            console.log('service', service);
            console.log('addressbook', addressbook);
        }
    }
});

4. Send callback

This callback will be executed after the user clicks the "Send" button on the mail screen

SocialInviter.set({
    authUrl: {
        development: 'http://127.0.0.1:5501/oauth.html',
        stage: 'https://stage.yourdomain.com/oauth.html',
    },
    style: {
        'font-family': 'Arial'
    },
    callbacks: {
        send: (service, profile, addressbook, selected, successObjects, errorObjects) => {
            // Your logic here
        }
    }
});

5. Service invite button callback

SocialInviter.set({
    authUrl: {
        development: 'http://127.0.0.1:5501/oauth.html',
        stage: 'https://stage.yourdomain.com/oauth.html',
    },
    style: {
        'font-family': 'Arial'
    },
    callbacks: {
        button: (product, service, e, profile, addressbook, selected) => {
            // Your logic here
        }
    }
});

6. Full example

You can use imported, proceed, send callback methods to receive the callback execution.

SocialInviter.set({
    authUrl: {
        development: 'http://127.0.0.1:5501/oauth.html',
        stage: 'https://stage.yourdomain.com/oauth.html',
    },
    style: {
        'font-family': 'Arial'
    },
    callbacks: {
        imported: (service, profile, addressbook) => {
            console.log('service', service);
            console.log('addressbook', addressbook);
        },
        proceed: (service, profile, addressbook, selected) => {
            console.log('service', service);
            console.log('addressbook', addressbook);
        },
        send: (service, profile, addressbook, selected, successObjects, errorObjects) => {
            console.log('service', service);
        },
        connect: (service, profile) => {
            if (service === "email") {
                // Your logic here for continue button click
                console.log(service, profile.email);
            } else {
                // Your logic here
            }
        },
        button: (product, service, e, profile, addressbook, selected) => {
            // Your logic here
        }
    }
});
6️
imported
connect
proceed
send
button