iOS Tutorial DropboxSync Tutorial

Dropbox has dropped support for this API. It doesn't work anymore.

The iDropboxSync library allows you to use Dropbox Sync service to manage an app specific folder inside the user Dropbox account.

It is similar to B4A DropboxSync library: http://www.b4x.com/android/forum/threads/dropbox-sync-library.30112/

The user can easily access these files from any device or computer:

SS-2014-11-17_10.20.03.png


When the user runs the app for the first time they will be asked to grant access to your app. If Dropbox app is installed then the user only needs to click on the button. Otherwise they will need to log-in to their account.

You can see the authorization step in this video:


Using this library

1. You need to register an app with Dropbox that has access to a unique folder:
https://www.dropbox.com/developers/apps
You need to get two values: app key and app secret.

2. If you are using a local mac builder then you need to download the SDK to your Mac computer and copy Dropbox.framework to the Libs folder.

3. The authorization step happens outside of your app. To allow Dropbox app (or the browser) to return back to your app you need to add the following attribute:
B4X:
#UrlScheme: db-ret331arjio70t6
Change the value after db- to your app key.

Application_OpenUrl will be called after the authorization step. You need to call manager.HandleOpenUrl:
B4X:
Private Sub Application_OpenUrl(Url As String, Data As Object) As Boolean
   Log("openurl: " & Url)
   manager.HandleOpenUrl(Url)
   Return True
End Sub

The AccountReady event is raised when the account is ready or when there was a problem with linking the account.
Now you can download or upload files to the account and manage your app specific folder.

When you download a file the DownloadCompleted event is raised when the file is ready. Note that the library always checks that the file is up to date (similar to B4A AutoSync flag).
 

Attachments

  • DropboxSync.zip
    52.2 KB · Views: 709
Last edited:

drponciano

Member
Licensed User
Longtime User
Downloaded de MAC SDK and Copied Dropbox.framework to the Libs folder on the Macserver. I get multiple error at compile time with the dropboxsync example. What am I doing wrong? Should I copy the dropbox.framework folder or the contents of the Version/A/Headers, etc. folder?
 

drponciano

Member
Licensed User
Longtime User
Out: Build settings from command line:
ARCHS = arm64
CODE_SIGN_IDENTITY = iPhone
CONFIGURATION_BUILD_DIR = /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload
OTHER_CODE_SIGN_FLAGS = --keychain b4i_default
PRODUCT_NAME = Dropbox Example
PROVISIONING_PROFILE = 42551aed-a1a1-4010-af36-421cc6b08539

=== BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===

Check dependencies
warning: all apps should include an armv7 architecture (current ARCHS = "arm64").

Write auxiliary files
/bin/mkdir -p /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build
write-file /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-all-non-framework-target-headers.hmap
write-file /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-generated-files.hmap
write-file /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-all-target-headers.hmap
write-file /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example.hmap
write-file /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-own-target-headers.hmap
/bin/mkdir -p /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64
write-file /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/Dropbox\ Example.LinkFileList
write-file /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-project-headers.hmap

Create product structure
/bin/mkdir -p /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/Dropbox\ Example.app

ProcessInfoPlistFile Payload/Dropbox\ Example.app/Info.plist B4iProject/B4iProject-Info.plist
cd /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
builtin-infoPlistUtility /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/B4iProject/B4iProject-Info.plist -genpkginfo /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/Dropbox\ Example.app/PkgInfo -expandbuildsettings -format binary -platform iphoneos -resourcerulesfile /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/Dropbox\ Example.app/ResourceRules.plist -o /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/Dropbox\ Example.app/Info.plist

CpResource /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/ResourceRules.plist Payload/Dropbox\ Example.app/ResourceRules.plist
cd /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/ResourceRules.plist /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/Dropbox\ Example.app

ProcessPCH /var/folders/tz/x8qrptsd6qjg46kc6km2h7040000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-cigfanbobziysefkmvfegqzmsxab/B4iProject-Prefix.pch.pch B4iProject/B4iProject-Prefix.pch normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c-header -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-generated-files.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-own-target-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-all-target-headers.hmap -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-project-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/arm64 -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload -F../../Libs -MD -MT dependencies -MF /var/folders/tz/x8qrptsd6qjg46kc6km2h7040000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-cigfanbobziysefkmvfegqzmsxab/B4iProject-Prefix.pch.d -c /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/B4iProject/B4iProject-Prefix.pch -o /var/folders/tz/x8qrptsd6qjg46kc6km2h7040000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-cigfanbobziysefkmvfegqzmsxab/B4iProject-Prefix.pch.pch --serialize-diagnostics /var/folders/tz/x8qrptsd6qjg46kc6km2h7040000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-cigfanbobziysefkmvfegqzmsxab/B4iProject-Prefix.pch.dia

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/main.o B4iProject/main.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-generated-files.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-own-target-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-all-target-headers.hmap -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-project-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/arm64 -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload -F../../Libs -include /var/folders/tz/x8qrptsd6qjg46kc6km2h7040000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-cigfanbobziysefkmvfegqzmsxab/B4iProject-Prefix.pch -MMD -MT dependencies -MF /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/main.d --serialize-diagnostics /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/main.dia -c /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/B4iProject/main.m -o /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/main.o

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_customlistview.o B4iProject/b4i_customlistview.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-generated-files.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-own-target-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-all-target-headers.hmap -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-project-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/arm64 -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload -F../../Libs -include /var/folders/tz/x8qrptsd6qjg46kc6km2h7040000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-cigfanbobziysefkmvfegqzmsxab/B4iProject-Prefix.pch -MMD -MT dependencies -MF /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_customlistview.d --serialize-diagnostics /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_customlistview.dia -c /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/B4iProject/b4i_customlistview.m -o /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_customlistview.o

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_main.o B4iProject/b4i_main.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-generated-files.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-own-target-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-all-target-headers.hmap -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-project-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/arm64 -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload -F../../Libs -include /var/folders/tz/x8qrptsd6qjg46kc6km2h7040000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-cigfanbobziysefkmvfegqzmsxab/B4iProject-Prefix.pch -MMD -MT dependencies -MF /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_main.d --serialize-diagnostics /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_main.dia -c /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/B4iProject/b4i_main.m -o /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_main.o

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/LS_1.o B4iProject/LS_1.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-generated-files.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-own-target-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-all-target-headers.hmap -iquote /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Dropbox\ Example-project-headers.hmap -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/arm64 -I/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload -F../../Libs -include /var/folders/tz/x8qrptsd6qjg46kc6km2h7040000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-cigfanbobziysefkmvfegqzmsxab/B4iProject-Prefix.pch -MMD -MT dependencies -MF /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/LS_1.d --serialize-diagnostics /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/LS_1.dia -c /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/B4iProject/LS_1.m -o /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/LS_1.o

Ld Payload/Dropbox\ Example.app/Dropbox\ Example normal arm64
cd /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -L/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload -L../../Libs -F/Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload -F../../Libs -filelist /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/Dropbox\ Example.LinkFileList -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -lCore -framework Foundation -framework CoreGraphics -framework UIKit -liDropboxSync -liHUD -framework AVFoundation -framework Dropbox -framework CFNetwork -framework Security -framework SystemConfiguration -framework QuartzCore -lz -lc++ -liDebug -Xlinker -dependency_info -Xlinker /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/Dropbox\ Example_dependency_info.dat -o /Users/jesusmondragon/Fuentes/b4i/macserver1.02/UploadedProjects/b4i_default/Payload/Dropbox\ Example.app/Dropbox\ Example
ld: warning: ignoring file ../../Libs/Dropbox.framework/Dropbox, file was built for x86_64 which is not the architecture being linked (arm64): ../../Libs/Dropbox.framework/Dropbox
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_DBAccountManager", referenced from:
objc-class-ref in libiDropboxSync.a(iDropboxSync.o)
"_OBJC_CLASS_$_DBFileInfo", referenced from:
objc-class-ref in libiDropboxSync.a(iDropboxSync.o)
"_OBJC_CLASS_$_DBFilesystem", referenced from:
objc-class-ref in libiDropboxSync.a(iDropboxSync.o)
"_OBJC_CLASS_$_DBPath", referenced from:
objc-class-ref in libiDropboxSync.a(iDropboxSync.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Error: ** BUILD FAILED **


The following build commands failed:
Ld Payload/Dropbox\ Example.app/Dropbox\ Example normal arm64
(1 failure)
 

drponciano

Member
Licensed User
Longtime User
My “mistake” Erel. I was using the “PC-Windows” file system when extracting and copying the Dropbox.framework to the Libs folder. Somehow, the Windows system does not “understand” the shortcuts, etc. that are used in the framework folder. When doing everything on the Mac side everything worked fine. Thanks for the help!
 

drponciano

Member
Licensed User
Longtime User
Hello: Still some problems with DropboxSync. I Use #PlistExtra: <key>UIApplicationExitsOnSuspend</key><true/> to stop my application when it goes to the background. When the app ask for authorization to access dropbox it exits and, when returning, it goes again to ask permission and so on. Any idea how I can go around this?
 

drponciano

Member
Licensed User
Longtime User
Yes, it is working fine in release mode if I don't use the "exitonsuspend" feature. Otherwise the app entera that loop asking permission.
 

tcgoh

Active Member
Licensed User
Longtime User
Hi,

I am very interested to get this function for my iphone app which required a constant upload of text/data file from outside.

my build B4i ver1.8, Dropboxsync V3.0

Problem running your example :
1. I went to https://www.dropbox.com/developers/apps, created a APP under DropBox API app
2. replace the APPkey and AppSecret strings in your example.
3. when I run the example I get this msg
upload_2015-2-13_10-19-1.png


What am I missing?
Thanks
 

tcgoh

Active Member
Licensed User
Longtime User
Hi Erel,

Thanks for pointing out the wrong library.

I this error when running the example. Any idea?
Application_Start
Application_Active
AccountReady
[WARNING] err: file.cpp:81: not_found: p(/x0.jpg) does not exist
[WARNING] err: file.cpp:89: disallowed: app is not allowed to create file p(/x0.jpg)
Error occurred on line: 51 (main)
Error opening file: Error Domain=dropbox.com Code=-10007 "The operation couldn’t be completed. (dropbox.com error -10007.)" UserInfo=0x15d89800 {ctx=-[DBFilesystem openFile:flags:error:], desc=DISALLOWED: file.cpp:89: app is not allowed to create file p(/x0.jpg)}
Stack Trace: (
CoreFoundation <redacted> + 154
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
Dropbox Example -[B4IDbxAccountManager getFile::] + 232
Dropbox Example -[B4IDbxAccountManager UploadFile::::] + 62
Dropbox Example -[b4i_main _manager_accountready:] + 2096
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 282
Dropbox Example +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1928
Dropbox Example -[B4IShell runMethod:] + 496
Dropbox Example -[B4IShell raiseEventImpl:method:args::] + 1846
Dropbox Example -[B4IShellBI raiseEvent:event:params:] + 1316
Dropbox Example __50-[B4I raiseEventFromDifferentThread:event:params:]_block_invoke + 74
libdispatch.dylib <redacted> + 10
libdispatch.dylib <redacted> + 22
libdispatch.dylib <redacted> + 268
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 1300
CoreFoundation CFRunLoopRunSpecific + 522
CoreFoundation CFRunLoopRunInMode + 106
GraphicsServices GSEventRunModal + 138
UIKit UIApplicationMain + 1136
Dropbox Example main + 116
libdyld.dylib <redacted> + 2
)

Thanks for you help
 

tcgoh

Active Member
Licensed User
Longtime User
[solve] [WARNING] err: file.cpp:89: disallowed: app is not allowed to create file p(/x0.jpg)

I did not add permission in dropbox sync app for jpg file.
 

Turbo3

Active Member
Licensed User
Longtime User
I would like to be able to setup a central Dropbox folder so all my app users can upload data to it. Is that possible?

I am not that familiar with all the features of Dropbox sharing but with the current limitation that the app can only access a folder under the Apps/AppName folder means that folder would need to be shared and still be located under the Apps/AppName folder on everyone's Dropbox. Is that possible?

When I setup for Dropbox access by the app there is an option to access already existing files in a Dropbox. Would that also allow access to already existing folders? If so how would that be coded in B4i to access an already existing folder?
 
Last edited:

Albi

Active Member
Licensed User
Longtime User
This is excellent, thanks!
Do you know if it's possible to also add comments to the files that are uploaded?
 

Albi

Active Member
Licensed User
Longtime User
thanks.
one more question - I can export from DirAssets to Dropbox, but don't seem to be able to from DirDocuments.
I get a 'cannot read' file error in the logs.

This is the code
B4X:
    For n = 0 To clvPics.GetSize - 1
        Dim pnl As Panel
        pnl = clvPics.GetPanel(n)
        Dim getID As String
        getID = pnl.GetView(0).Tag
        Dim img1 As ImageView
        img1.Initialize("")
        img1 = pnl.GetView(0)
        Dim outPic As OutputStream = File.OpenOutput(File.DirDocuments, "DBshare", False)
        img1.Bitmap.WriteToStream(outPic, 100, "png")
        outPic.close
        'upload file
        manager.UploadFile(File.DirDocuments, "DBshare.png", "/", getID & ".png")
    Next

and this is the error message, (with bits omitted for privacy?)

Error uploading file: Error Domain=dropbox.com Code=-10008 "The operation couldn’t be completed. (dropbox.com error -10008.)" UserInfo=xxxxxx {ctx=-[DBFilesystem file:writeContentsOfFile:shouldSteal:error:], desc=FILE_IO: file.cpp:663: cannot read /var/mobile/Containers/Data/Application/xxx-xxx-xxx-xxx-xx/Documents/DBshare.png}

Thanks for any help!
 
Top