cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Sync Photos folder with dropbox using Xmarin Ios

New member | Level 1
New member | Level 1

Hello Team,

I'm developing mobile application using xamarin forms.

I need to do a sync with dropbox of photos, database and folder.

I have used Dropbox Sync & DataStore component.

 

I have done with single file sync.

But my scenario is like that, Suppose I'm capturing photo from app and when I save it in folder as well as doing entry in sqlite database. So I want that that new photo sync with dropbox. So my main concern is that captured photo save in app folder as well as sync with dropbox app folder. So when I open my dropbox and go into app folder, I'm able to see that captured photo.

I'm using Xmarin Technology.

 

10 Replies 10
Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

Dropboxer
Dropboxer

I'm not sure I understand your question. Could you share the code you've written so far and where you ran into trouble?

I should also point out that the Sync and Datastore APIs have been deprecated. You might instead want to use the .NET SDK for API v2.

Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

New member | Level 1
New member | Level 1

Hello Steve,

 

Thanks for your quick replay.

I want to share my mobile camera roll folder with dropbox as well as Sqlite database. Would you please assist me what I need to do for this.

I have used Xamarin Technology.

Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

New member | Level 1
New member | Level 1

Hello Steve,

 

Would you please assist me best way for sync with dropbox for xamarin ios technology.

Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

Dropboxer
Dropboxer

I'm not sure how to help you. It seems like maybe you haven't started writing code yet? https://www.dropbox.com/developers will tell you all about the platform. In particular, I would think you want the .NET SDK, given that you're using Xamarin.

Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

New member | Level 1
New member | Level 1

Hi Steve,

 

I have created app in console and give you sample code here.



[assembly: Xamarin.Forms.Dependency (typeof (TextToSpeech_iOS))]
namespace DependencyService.iOS
{
    public class TextToSpeech_iOS:ITextToSpeech
    {
        public TextToSpeech_iOS () {}

        UINavigationController navController;
        UIWindow window;

        const string DropboxSyncKey = "<redacted>";
        const string DropboxSyncSecret = "<redacted>";

        public void UploadPhoto(string text)
        {
            UINavigationBar.Appearance.TintColor = UIColor.FromRGB (29, 131, 219);

            window = new UIWindow (UIScreen.MainScreen.Bounds);    
            window.BackgroundColor = UIColor.White;
            window.Bounds = UIScreen.MainScreen.Bounds;

            //var u = new TaskListScreen();
            navController = new UINavigationController();
            //navController.PushViewController (u, false);

            window.RootViewController = navController;
            window.MakeKeyAndVisible ();
            // DROPBOX STUFF
            // The account manager stores all the account info. Create this when your app launches
            var manager = new DBAccountManager (DropboxSyncKey, DropboxSyncSecret);
            DBAccountManager.SharedManager = manager;

            var account = manager.LinkedAccount;
            if (account != null) {
                DropboxDatabase.Shared.SetupDropbox ();
            }  else
                manager.LinkFromController (window.RootViewController);    


        }
    }
}

----------------

Appdelegate.cs

public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
        {
            var account = DBAccountManager.SharedManager.HandleOpenURL (url);
            var filesystem = new DBFilesystem (account);
            DBFilesystem.SharedFilesystem = filesystem;

            DropboxDatabase.Shared.SetupDropbox ();
            return account != null;
        }

Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

New member | Level 1
New member | Level 1

I have used Dropbox Sync & DataStore component. But as per your last replay, that this thing is now deprecated. So as you suggest to use .NET SDK for API v2. But would you please tell me how api v2 will be use in xamarin.

Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

Dropboxer
Dropboxer

So what's your question? Does your code do what you want it to? If not, what sort of issue did you run into?

Yes, I would suggest using the .NET SDK. I don't understand what you mean by "would you please tell me how api v2 will be use in xamarin." Did you try using the SDK? Did you have trouble?

Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

New member | Level 1
New member | Level 1

I have used Dropbox component and I have posted code above. But now you said that is deprecated and suggest me to use api v2. I'm trying to use api v2 in xamarin forms. But would you please let me know how this will be used for authentication.

Second thing, how api v2 will used for database sync and photo library sync.

 

 

 

 

Highlighted

Re: Sync Photos folder with dropbox using Xmarin Ios

New member | Level 1
New member | Level 1

Steve are you still there?

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?