6
Callbacks

1. Imported callback

This callback will be executed after the contacts are imported
1
SocialInviter.set({
2
authUrl: {
3
development: 'http://127.0.0.1:5501/oauth.html',
4
stage: 'https://stage.yourdomain.com/oauth.html',
5
},
6
style: {
7
'font-family': 'Arial'
8
},
9
callbacks: {
10
imported: (service, profile, addressbook) => {
11
console.log('service', service);
12
console.log('addressbook', addressbook);
13
}
14
}
15
});
Copied!

2. Proceed callback

This callback will be executed once a user clicks on the "Proceed" button on the contacts screen
1
SocialInviter.set({
2
authUrl: {
3
development: 'http://127.0.0.1:5501/oauth.html',
4
stage: 'https://stage.yourdomain.com/oauth.html',
5
},
6
style: {
7
'font-family': 'Arial'
8
},
9
callbacks: {
10
proceed: (service, profile, addressbook, selected) => {
11
console.log('service', service);
12
console.log('addressbook', addressbook);
13
}
14
}
15
});
Copied!

3. Send callback

This callback will be executed after the user clicks the "Send" button on the mail screen
1
SocialInviter.set({
2
authUrl: {
3
development: 'http://127.0.0.1:5501/oauth.html',
4
stage: 'https://stage.yourdomain.com/oauth.html',
5
},
6
style: {
7
'font-family': 'Arial'
8
},
9
callbacks: {
10
send: (service, profile, addressbook, selected, successObjects, errorObjects) => {
11
console.log('service', service);
12
}
13
}
14
});
Copied!

4. Full example

You can use imported, proceed, send callback methods to receive the callback execution.
1
SocialInviter.set({
2
authUrl: {
3
development: 'http://127.0.0.1:5501/oauth.html',
4
stage: 'https://stage.yourdomain.com/oauth.html',
5
},
6
style: {
7
'font-family': 'Arial'
8
},
9
callbacks: {
10
imported: (service, profile, addressbook) => {
11
console.log('service', service);
12
console.log('addressbook', addressbook);
13
},
14
proceed: (service, profile, addressbook, selected) => {
15
console.log('service', service);
16
console.log('addressbook', addressbook);
17
},
18
send: (service, profile, addressbook, selected, successObjects, errorObjects) => {
19
console.log('service', service);
20
}
21
}
22
});
Copied!