I want to integrate outlook calendar API and fetch the events from outlook calendar and add them into my flutter app but I can't find any proper guide to do this so my question is how I can integrate outlook calendar API in my flutter app.
Asked
Active
Viewed 2,128 times
1
-
You can try to use [retrofit](https://pub.dev/packages/retrofit) or [chopper](https://pub.dev/packages/chopper) to communicate with Outlook Calendar API(as with any other API). Have you tried this? – konstantin_doncov Mar 28 '20 at 21:25
1 Answers
1
First, you add o auth2 Client pub package
https://pub.dev/packages/oauth2_client
class Something{
Future fetchOutlookCalender(
{BlockCreateCustomTaskBucket provider}) async {
var client = OAuth2Client(
authorizeUrl:
'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
tokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
redirectUri: 'com.example.upticker://oauth2redirect',
customUriScheme: 'com.example.upticker');
var token = await client.getTokenWithAuthCodeFlow(
clientId: '32502b36-55b3-44b7-88ab-cf8d0ce273dc',
scopes: ['openid profile offline_access user.read calendars.read']);
print('accesstoken: '${token.accessToken}',')
}
-
-
its shows error Invalid argument (callbackUrlScheme): must be a valid URL scheme: "com.test.app" – Aqib shahzad Feb 28 '23 at 07:05