【问题标题】:How to integrate outlook calendar API and fetch the events from outlook calendar in flutter?如何集成 Outlook 日历 API 并在 Flutter 中从 Outlook 日历中获取事件?
【发布时间】:2020-03-28 16:15:52
【问题描述】:

我想集成 Outlook 日历 API 并从 Outlook 日历中获取事件并将它们添加到我的颤振应用程序中,但我找不到任何合适的指南来执行此操作,所以我的问题是如何将 Outlook 日历 API 集成到我的颤振中应用程序。

【问题讨论】:

  • 您可以尝试使用retrofitchopper 与 Outlook 日历 API 进行通信(与任何其他 API 一样)。你试过这个吗?

标签: flutter dart microsoft-graph-api outlook-calendar outlook-api


【解决方案1】:

首先,你添加 o auth2 Client pub 包

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}',')
}

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-08-10
  • 2022-07-14
  • 2022-08-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-25
相关资源
最近更新 更多