add events to outlook calendar from flutter
I am currently working on an app where I want to add an event to the outlook calendar when making a booking. I have searched around and I was not able to find any proper guide to help me.
My question is: how can I integrate the outlook calendar into my flutter app.
1 answer
-
answered 2022-05-04 12:54
Eugene Astafiev
You can use MS Graph for getting this implemented, see Create event for more information. Use this API to create a new event in a calendar. The calendar can be one for a user, or the default calendar of a Microsoft 365 group. You may find the sample code in the Create calendar event using Microsoft Graph Client thread.
do you know?
how many words do you know
See also questions close to this topic
-
how to change prettier format for react native
my code formatting prettier didn't works well for react native, i don't understand where to config it but it works well with flutter
from this code
import { View, Text } from 'react-native' import React from 'react' export default function App() { return ( <View> <Text>Apps</Text> </View> ) }
it's formatted to this
import { View, Text } from 'react-native' import React from 'react' export default function App() { return ( < View > < Text > Apps < /Text> < /View> ) }
-
How to group firebase data in flutter with DateTime?
I am making a chat application in flutter using firebase. I want to show a header with the date whenever the date changes. How can I group messages in flutter coming from firebase on the basis of date and show a header with the changed date?
I have tried GroupedListView package but I was not able to retrieve the chatmessages successfully.
-
Can you make complete apps using Flutter & Dart or just the UI part of an app?
I'm confused about what Flutter framework actually does, I know that it uses Dart and have heard that both of them can be used to create cross-platform apps.
But Wikipedia defines Flutter as a "UI Framework", so my question is, can you make a complete app (for mobile) which also has backend part (communicates with a database) built entirely using Flutter & Dart and not only the UI part?
If you didn't get my question, here is an example:
Suppose a front-end web developer works on client side programming in his job, and the backend logic is written by another backend developer.
When it comes to mobile app development, suppose as a Flutter developer, your job is to create apps, but does that mean that as a Flutter developer, you'll only write the front-end logic and leave the backend part for another backend developer like in web world? Can Flutter developers also write the backend of an app using only Flutter & Dart? If not, then who writes the backend of a mobile app and what tools/languages/frameworks does he uses?
-
dart modulo operator circular list
I want to use the modulo (%) operator in order to access to list items in a circular way. But the code below doesn't work:
void main() { List<String> myList = ['one', 'two', 'three', 'four']; int currIdx = 0; for (int i = 0;i < 10;i++) { print(myList[currIdx]); currIdx = currIdx++ % myList.length; } }
- Outlook VSTO - Get all items in a group calendar
-
How to set outlook addins pinned right away?
I set the SupportsPinning to true for outlook addins by modifying the manifest file as shown below. This allows the pin icon available. By default, the Pin is not selected. So is there a way to have the addins PINNED right away?
<!-- Task pane button --> <Control xsi:type="Button" id="msgReadOpenPaneButton"> ...... <Action xsi:type="ShowTaskpane"> <SourceLocation resid="readTaskPaneUrl" /> <SupportsPinning>true</SupportsPinning> </Action> </Control>
-
Send SVG image content to email as HTML using boto3
I want to send SVG content (without saved file) as HTML to Outlook email address. This SVG content works fine in browser showing a circle image, however sending it via boto3.client to Outlook email results in empty mail. Why? Any suggestions appreciated.
import io import json import boto3 from botocore.exceptions import ClientError SENDER = "Name1 LastName1 <Name1.LastName1@mail.com>" RECIPIENT = "Name2 LastName2 <Name2.LastName2@mail.com>" AWS_REGION = "us-east-1" SUBJECT = "something" svg = """ <svg width="100" height="100"> <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /> </svg> """ BODY_HTML = f"""<html> <body> {svg} </body> </html> """ CHARSET = "UTF-8" client = boto3.client('ses',region_name=AWS_REGION) try: response = client.send_email( Destination={ 'ToAddresses': [ RECIPIENT ], }, Message={ 'Body': { 'Html': { 'Charset': CHARSET, 'Data': BODY_HTML } }, 'Subject': { 'Charset': CHARSET, 'Data': SUBJECT }, }, Source=SENDER ) except ClientError as e: print(e.response['Error']['Message']) else: print("Email sent! Message ID:"), print(response['MessageId'])
-
java.lang.IndexOutOfBoundsException: Index: 6, Size: 5
I am trying to get data from an sql database based on the date. So I have a custom library for a calendar above and when you click on one of the dates it compares it to the date above and based on the result gets the date. But I am having quite a problem here and it has been going around for a while now.
So here is my code:
private class SyncData extends AsyncTask<String, String, String> { String msg; @Override protected void onPreExecute() //Starts the progress dailog { //progress } @Override protected String doInBackground(String... strings) // Connect to the database, write query and add items to array list { try { Connection con = connectionClass.CONN(); if (con == null) { msg = "Sorry something went wrong,Please check your internet connection"; } else { String query = "select MAX(CashierMovment.CashierMovementSerial) AS MovementSerial,MAX(CashierMovementStatus) AS CashierStatus,MAX(CashierOpenDate) AS OpenDate,MAX(CashierCloseDate) CloseDate,MAX(BranchID) AS BranchID,MAX(CashierTransactions.BondID) AS BondID,MAX(PaymentReceiveBondSetting.BondName) AS BondName, SUM(CashierTransactions.TotalValue) AS Total\n" + "From CashierMovment INNER JOIN CashierTransactions \n" + "ON CashierMovment.CashierMovementSerial = CashierTransactions.CashierMovementSerial \n" + "INNER JOIN PaymentReceiveBondSetting ON CashierTransactions.BondID = PaymentReceiveBondSetting.BondID\n" + "WHERE CashierTransactions.TotalValue IS NOT NULL AND BranchID = \n" + getIntent().getStringExtra("ID") + " GROUP BY CashierOpenDate ORDER BY CashierOpenDate "; Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(query); itemArrayList.clear(); if (rs != null) // if resultset not null, I add items to itemArraylist using class created { while (rs.next()) { System.out.println("BRANCH IDDD" + rs.getString("OpenDate")); itemArrayList.add(new ClassListBranchData(rs.getString("MovementSerial"), rs.getString("CashierStatus"), rs.getString("OpenDate"), rs.getString("Total"), rs.getString("BondName"))); //itemArrayList2.add(new BondArrayList(rs2.getString("MovementSerial"),rs2.getString("BondName"),rs2.getString("Total"),rs2.getString("OpenDate"))); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); try { int month = 0; int month2 = 0; Calendar cal = Calendar.getInstance(); Date d = sdf.parse(itemArrayList.get(0).getCashierOpenDate()); cal.setTime(d); month = checkDigit(cal.get(Calendar.MONTH) + 1); Calendar cal2 = Calendar.getInstance(); Date d2 = sdf.parse(itemArrayList.get(itemArrayList.size() - 1).getCashierOpenDate()); cal2.setTime(d2); month2 = checkDigit(cal2.get(Calendar.MONTH) + 1); Calendar endDate = Calendar.getInstance(); endDate.add(Calendar.MONTH, 0); Calendar startDate = Calendar.getInstance(); startDate.add(cal.get(Calendar.MONTH), -1); System.out.println(cal2.getTime() + " " + cal.getTime()); Double num = Double.parseDouble(itemArrayList.get(itemArrayList.size() - 1).getTotalValue()); DecimalFormat svSE = new DecimalFormat("#,###.000"); String result = svSE.format(num); //format.setMinimumFractionDigits(0); BranchDataNew.this.runOnUiThread(new Runnable() { public void run() { totalbyday.setText(result); horizontalCalendar = new HorizontalCalendar.Builder(BranchDataNew.this, R.id.horizontalcalendarview) .startDate(cal.getTime()) .endDate(cal2.getTime()) .centerToday(false) .datesNumberOnScreen(5) .dayFormat("EEE") // WeekDay text format .dayNumberFormat("dd") // Date format .textColor(Color.LTGRAY, Color.BLACK) // Text color for none selected Dates, Text color for selected Date. .selectedDateBackground(Color.TRANSPARENT) // Background color of the selected date cell. .build(); horizontalCalendar.setCalendarListener(new HorizontalCalendarListener() { @Override public void onDateSelected(Date date, int position2) { SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd", Locale.getDefault()); String formattedDate = df.format(date); System.out.println("NEW DATEE " + formattedDate); int position = getIndexByname(formattedDate); if (position != -1){ Calendar call = Calendar.getInstance(); Calendar callL = Calendar.getInstance(); try { d22 = sdf.parse(itemArrayList.get(position).getCashierOpenDate()); } catch (ParseException e) { e.printStackTrace(); } call.setTime(d22); callL.setTime(date); System.out.println("HERE BROOO " +call.getTime() + " " +callL.getTime()); if (call.getTime().equals(callL.getTime())){ System.out.println("HERE BROOO2222 " + itemArrayList.get(position).getTotalValue()); Double num = Double.parseDouble(itemArrayList.get(position).getTotalValue()); DecimalFormat svSE = new DecimalFormat("#,###.000"); String result = svSE.format(num); totalbyday.setText(result); dateup = date; SyncData2 syncData2 = new SyncData2(); syncData2.execute(); SyncData3 syncData3 = new SyncData3(); syncData3.execute(); SyncData4 syncData4 = new SyncData4(); syncData4.execute(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); chart.animateY(1400, Easing.EaseInOutQuad); chart.setBackgroundColor(Color.WHITE); // moveOffScreen(); chart.setUsePercentValues(true); chart.getDescription().setEnabled(false); chart.setCenterTextTypeface(tfLight); chart.setCenterText(generateCenterSpannableText()); chart.setDrawHoleEnabled(true); chart.setHoleColor(Color.WHITE); chart.setTransparentCircleColor(Color.WHITE); chart.setTransparentCircleAlpha(110); chart.setHoleRadius(58f); chart.setTransparentCircleRadius(61f); chart.setDrawCenterText(true); chart.setRotationEnabled(false); chart.setHighlightPerTapEnabled(true); chart.setMaxAngle(180f); // HALF CHART chart.setRotationAngle(180f); chart.setCenterTextOffset(0, -20); Legend l = chart.getLegend(); l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP); l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER); l.setOrientation(Legend.LegendOrientation.HORIZONTAL); l.setDrawInside(false); l.setXEntrySpace(7f); l.setYEntrySpace(0f); l.setYOffset(0f); double total = getTotal(itemArrayList); float totalf = (float) total; // entry label styling chart.setEntryLabelColor(Color.WHITE); chart.setEntryLabelTypeface(tfRegular); chart.setEntryLabelTextSize(12f); setData(2, totalf, Double.parseDouble(itemArrayList.get(position2 -2).getTotalValue())); }else { Toast.makeText(BranchDataNew.this,"No Data on this day", Toast.LENGTH_SHORT).show(); } } } @Override public void onCalendarScroll(HorizontalCalendarView calendarView, int dx, int dy) { } @Override public boolean onDateLongClicked(Date date, int position) { return true; } }); } }); // dateup = cal2.getTime(); // SyncData2 syncData2 = new SyncData2(); // syncData2.execute(); } catch (ParseException e) { e.printStackTrace(); System.out.println("YASTAAAAA "+e.getMessage()); } } msg = "Found"; success = true; } else { msg = "No Data found!"; success = false; } } } catch (Exception e) { System.out.println("exceptions" + e); e.printStackTrace(); Writer writer = new StringWriter(); e.printStackTrace(new PrintWriter(writer)); msg = writer.toString(); Log.d("Error", writer.toString()); success = false; } return msg; } @Override protected void onPostExecute(String msg) // disimissing progress dialoge, showing error and setting up my listview { //hide progress if (msg != null) { // Toast.makeText(BranchDataNew.this, msg + "", Toast.LENGTH_LONG).show(); } if (!success) { } else { try { } catch (Exception ex) { } } } }
And I think my problem occurs here:
if (position != -1){ Calendar call = Calendar.getInstance(); Calendar callL = Calendar.getInstance(); try { d22 = sdf.parse(itemArrayList.get(position).getCashierOpenDate()); } catch (ParseException e) { e.printStackTrace(); }
I get
java.lang.IndexOutOfBoundsException: Index: 6, Size: 5
whenever I click on a date so when theonDateSelected
method is called. I would appreciate any help! -
Let users hide posts on wordpress website
I'm building a Wordpress website with events. People can register to this website and view the events I have placed inside a calendar. People can RSVP to an event OR they can hide an event.
What I want: Every user needs the possibility to hide an event but only for him or herself. Not for every user.
My problem: Whenever I try to hide a post, it's hidden for every user. Not just for that one user that wants to hide it.
How can I achieve this? I spent hours looking online but couldn't find a solution. Thank you in advance!
-
Sync Google Sheet and Google Calendar by ID preventing duplicates
With this code I could put the events from google spreadsheet to google calendar, but now I would to sync these events between the two platforms by a unique ID I could store in the spreadsheet.
First of all, I am trying to set a trigger every 5 minutes, but I don't know if it is the best solution, considering also that the events on the sheet are more than 300 (and they could increase, but with 5 or 6 new events every day) and so I would avoid the error Error: "You have been creating or deleting too many calendars or calendar events in a short time."
The second thing I am trying to do is to call the id from the google calendar to the column A of the sheet but without success.
How could I proceed?
function sendToCal() { var spreadsheet = SpreadsheetApp.getActive().getSheetByName('XCALENDAR') let eventCal = CalendarApp.getCalendarById("xxx"); var signups = spreadsheet.getRange("A2:M").getValues(); for (x = 0; x < signups.length; x++) { var shift = signups[x]; let d = shift[3] let e = shift[4].split(":") let f = shift[5] let g = shift[6].split(":") var startTime = new Date(d.getFullYear(),d.getMonth(),d.getDate(),parseInt(e[0]),parseInt(e[1]),0); var endTime = new Date(f.getFullYear(),f.getMonth(),f.getDate(),parseInt(g[0]),parseInt(g[1]),0); var nameevent = shift[1]; var desc = shift[11]; var color = shift[12]; var event = eventCal.createEvent(nameevent, startTime, endTime, { description: desc }); if (color) { event.setColor(CalendarApp.EventColor[color]); } } }
-
Microsoft-Graph: Invoke-MgGraphRequest returns unable to cast object of type JsonObject to JsonArray
I am trying to use Invoke-MgGraphRequest to convert immutableEntryIds to ewsIDs. I have been following Microsoft's documentation and have created the following PowerShell script:
Import-Module Microsoft.Graph.Users.Actions $params = @{ InputIds = @( "{<my immutable EntryID 1>}", "{<my immutable EntryID 2>}" ) SourceIdType = "immutableEntryId" TargetIdType = "ewsId" } Invoke-MgTranslateUserExchangeId -UserId $userId -BodyParameter $params
Running this script results in the following error:
Invoke-MgTranslateUserExchangeId : Unable to cast object of type 'Microsoft.Graph.PowerShell.Runtime.Json.JsonObject' to type 'Microsoft.Graph.PowerShell.Runtime.Json.JsonArray'. At line:1 char:1 + Invoke-MgTranslateUserExchangeId -UserId $userId -BodyParameter $para ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Invoke-MgTransl...geId_Translate1], InvalidCastException + FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.InvokeMgTranslateUserExchangeId_Translate1
I have seen similar errors for other MgGraph commands that are open issues on Github. Has anyone been able to get the Invoke-MgTranslateUserExchangeId command without this error occuring?
-
How to get/set Azure AD B2C User MFA details via Microsoft Graph API
Using the Microsoft Graph API v 1.0, how can I retrieve the user's MFA details?
For example, if I have an email based sign-in/sign-up policy with phone/SMS MFA, how can I see the phone number entered by the user? (and also set update it)
I know if I select 'identities' in the GET /users method I can see the email they've signed up with, but not the phone number they set for MFA. (https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0)
Of course I'm looking for all the mfa settings: mfa phone number, mfa email address, is mfa set, etc.
Hopefully there is some kind of extension attribute that contains this that I can select, and set on creation, but I cannot find documentation on this.
[UPDATE] In the Azure portal, I can see the entered data if I go to user > profile > authentication methods. So I tried accessing the authentication relationships on the user. but it didn't provide any details (all empty arrays) https://docs.microsoft.com/en-us/graph/api/resources/authentication?view=graph-rest-1.0
-
AADSTS900144: The request body must contain the following parameter: 'grant_type'
I am trying to generate the Access_Token after generating the Authorization code using MS Graph API.
I am getting the following error (Screen shot below)
"error_description": "AADSTS900144: The request body must contain the following parameter: 'grant_type'.",
I see that grant_type is present. I checked the rest of the values to be without any spaces. Any ideas on what could be wrong here? I appreciate your support.
Thanks,