Quick Links

[Xamarin Blog] Add Some Storage to Your Apps

I've just posted a blog 'Add Some Storage to Your Apps' which talks about integrating Office 365 component: OneDrive for Business in Xamarin mobile apps. Use this thread to discuss the topic, post questions or share your feedback.

The sample should work for iOS with just one change. And that has to be during authentication flow. Authentication flow differs on platforms, rest of the stuff is same; as it is just calling the REST APIs internally.
You may want to give it a try. The change should be in GetAccessToken method, where Context is not required. So, you can just pass new AuthorizationParameters().
Do let me know if you face any challenges and I'll try it myself.

Sample isn't working. After authenticate I get following exception:
Any tips to resolve this? Thanks

Java.Lang.RuntimeException: java.lang.reflect.InvocationTargetException at --- End of managed exception stack trace --- at java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at at dalvik.system.NativeStart.main(Native Method) at Caused by: java.lang.reflect.InvocationTargetException at at java.lang.reflect.Method.invokeNative(Native Method) at at java.lang.reflect.Method.invoke(Method.java:515) at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at ... 2 more at Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: Microsoft.Office365.Discovery.DiscoveryFailedException: Exception of type 'Microsoft.Office365.Discovery.DiscoveryFailedException' was thrown. at at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x0004b> at at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <IL 0x00006, 0x0003b> at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d23da369/source/monodroid/src/Mono.Android/src/Android.App/SyncContext.cs:18 at Java.Lang.Thread/RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d23da369/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36 at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) [0x00009] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d23da369/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Java.Lang.IRunnable.cs:71 at at (wrapper dynamic-method) object.53a635e4-c3ae-4264-99f1-cc204228b19f (intptr,intptr) <IL 0x00011, 0x00027> at at mono.java.lang.RunnableImplementor.n_run(Native Method) at at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29) at at android.os.Handler.handleCallback(Handler.java:733) at at android.os.Handler.dispatchMessage(Handler.java:95) at at android.os.Looper.loop(Looper.java:136) at at android.app.ActivityThread.main(ActivityThread.java:5017) at ... 5 more

With Graph API covering OneDrive, it makes sense to use those APIs to access files. I've written couple of blog posts about Graph API get started. The sample for the same has been updated to use latest APIs and you can find it here.
And you can find the documentation for Graph API - Files here.