Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
a28cf2ce
Commit
a28cf2ce
authored
Oct 22, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dropbox controller: added support to share credentials
parent
367a6699
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
Sources/VLCConstants.h
Sources/VLCConstants.h
+1
-0
Sources/VLCDropboxController.h
Sources/VLCDropboxController.h
+3
-0
Sources/VLCDropboxController.m
Sources/VLCDropboxController.m
+28
-1
No files found.
Sources/VLCConstants.h
View file @
a28cf2ce
...
...
@@ -86,6 +86,7 @@
#endif
#define kVLCStoredServerList @"kVLCStoredServerList"
#define kVLCStoreDropboxCredentials @"kVLCStoreDropboxCredentials"
#define kVLCUserActivityPlaying @"org.videolan.vlc-ios.playing"
#define kVLCUserActivityLibrarySelection @"org.videolan.vlc-ios.libraryselection"
...
...
Sources/VLCDropboxController.h
View file @
a28cf2ce
...
...
@@ -23,6 +23,9 @@
+
(
instancetype
)
sharedInstance
;
-
(
void
)
shareCredentials
;
-
(
BOOL
)
restoreFromSharedCredentials
;
-
(
void
)
downloadFileToDocumentFolder
:(
DBMetadata
*
)
file
;
-
(
void
)
streamFile
:(
DBMetadata
*
)
file
;
...
...
Sources/VLCDropboxController.m
View file @
a28cf2ce
...
...
@@ -20,6 +20,7 @@
#import "VLCActivityManager.h"
#import "VLCMediaFileDiscoverer.h"
#endif
#import "DBKeychain.h"
@interface
VLCDropboxController
()
{
...
...
@@ -50,11 +51,36 @@
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCDropboxController
new
];
[
sharedInstance
shareCredentials
];
});
return
sharedInstance
;
}
-
(
void
)
shareCredentials
{
/* share our credentials */
NSDictionary
*
credentials
=
[
DBKeychain
credentials
];
if
(
credentials
==
nil
)
return
;
NSUbiquitousKeyValueStore
*
ubiquitousStore
=
[
NSUbiquitousKeyValueStore
defaultStore
];
[
ubiquitousStore
setDictionary
:
credentials
forKey
:
kVLCStoreDropboxCredentials
];
[
ubiquitousStore
synchronize
];
}
-
(
BOOL
)
restoreFromSharedCredentials
{
NSUbiquitousKeyValueStore
*
ubiquitousStore
=
[
NSUbiquitousKeyValueStore
defaultStore
];
[
ubiquitousStore
synchronize
];
NSDictionary
*
credentials
=
[
ubiquitousStore
dictionaryForKey
:
kVLCStoreDropboxCredentials
];
if
(
!
credentials
)
return
NO
;
[
DBKeychain
setCredentials
:
credentials
];
return
YES
;
}
-
(
void
)
startSession
{
[[
DBSession
sharedSession
]
isLinked
];
...
...
@@ -139,7 +165,8 @@
return
NO
;
}
-
(
void
)
restClient
:(
DBRestClient
*
)
client
loadedMetadata
:(
DBMetadata
*
)
metadata
{
-
(
void
)
restClient
:(
DBRestClient
*
)
client
loadedMetadata
:(
DBMetadata
*
)
metadata
{
NSMutableArray
*
listOfGoodFilesAndFolders
=
[[
NSMutableArray
alloc
]
init
];
if
(
metadata
.
isDirectory
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment