<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Android app fails authentication if Dropbox app isn't installed... in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248008#M14225</link>
    <description>&lt;P&gt;Thanks! You shouldn't have to do anything different depending on whether or not the official Dropbox app is installed. They should both use the same flow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, does &lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android" target="_self"&gt;the Android sample app&lt;/A&gt; display the same issue for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I noticed you mentioned that code is in "onReturn". Did you mean "onResume"?&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2017 19:55:13 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-10-19T19:55:13Z</dc:date>
    <item>
      <title>Android app fails authentication if Dropbox app isn't installed...</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/247824#M14204</link>
      <description>&lt;P&gt;Dropbox API/SDK 3.0.5&lt;/P&gt;
&lt;P&gt;Android target 19&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After verifying there is no saved access token, I'm kicking off the authentication flow with:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Auth&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;startOAuth2Authentication&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;getApplicationContext&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;getString&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;R.string&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;app_key&lt;/SPAN&gt;&lt;SPAN&gt;));&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;And then I retrieve/check the access token in the onResume() of my activity.&amp;nbsp; If the Dropbox app is installed on the device, everything works great.&amp;nbsp; If the Dropbox app isn't installed, no token is retrievable/available when control is passed back to the activity.&amp;nbsp; I am prompted for credentials and permissions via the Dropbox website.&amp;nbsp; I have the appropriate Dropbox activity defined in my AndroidManifest.xml with the appropriate db key.&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;data &lt;/SPAN&gt;&lt;SPAN&gt;android&lt;/SPAN&gt;&lt;SPAN&gt;:scheme=&lt;/SPAN&gt;&lt;SPAN&gt;"db-xxxxxxxxxxxxxxx" &lt;/SPAN&gt;&lt;SPAN&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I've been searching all day and haven't hit on the right search string to obtain any insight.&amp;nbsp; Any help would be greatly appreciated.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:18:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/247824#M14204</guid>
      <dc:creator>T3chDad</dc:creator>
      <dc:date>2019-05-29T09:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Android app fails authentication if Dropbox app isn't installed...</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/247938#M14212</link>
      <description>Can you elaborate on what you mean when you say "no token is retrievable/available when control is passed back to the activity"? What piece of code isn't behaving as expected, and what does it do instead?&lt;BR /&gt;&lt;BR /&gt;For reference, to receive the token you should be calling Auth.getOAuth2Token as shown here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L22" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L22&lt;/A&gt;</description>
      <pubDate>Thu, 19 Oct 2017 15:36:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/247938#M14212</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-19T15:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Android app fails authentication if Dropbox app isn't installed...</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/247942#M14213</link>
      <description>&lt;P&gt;Using that call returns null after authenticating to Dropbox and allowing the access via the authentication web page. Here's my code that's in my onReturn().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ACCESS_TOKEN = Auth.getOAuth2Token();&lt;BR /&gt;if (ACCESS_TOKEN != null) {&lt;BR /&gt; System.out.println("-------Got token from Auth session");&lt;BR /&gt; prefs.edit().putString("access-token", ACCESS_TOKEN).apply();&lt;BR /&gt; Toast.makeText(getApplicationContext(), "Dropbox authentication succeeded...", Toast.LENGTH_SHORT).show();&lt;BR /&gt; new DropboxGetFileInfo().execute();&lt;BR /&gt;} else {&lt;BR /&gt; System.out.println("-------Authentication either failed or was canceled.");&lt;BR /&gt; Toast.makeText(getApplicationContext(), "Dropbox authentication failed...", Toast.LENGTH_SHORT).show();&lt;BR /&gt; Intent i = new Intent(Synchronize.this, FlightLog.class);&lt;BR /&gt; setResult(RESULT_CANCELED, i);&lt;BR /&gt; finish();&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;Remember, all this works fine&amp;nbsp;&lt;STRONG&gt;IF&lt;/STRONG&gt; the Dropbox app is installed on the device.&amp;nbsp; The access token is null when the Dropbox app isn't installed and it's using the authentication pages on the Dropbox website.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 15:57:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/247942#M14213</guid>
      <dc:creator>T3chDad</dc:creator>
      <dc:date>2017-10-19T15:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Android app fails authentication if Dropbox app isn't installed...</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248008#M14225</link>
      <description>&lt;P&gt;Thanks! You shouldn't have to do anything different depending on whether or not the official Dropbox app is installed. They should both use the same flow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, does &lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android" target="_self"&gt;the Android sample app&lt;/A&gt; display the same issue for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I noticed you mentioned that code is in "onReturn". Did you mean "onResume"?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 19:55:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248008#M14225</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-19T19:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Android app fails authentication if Dropbox app isn't installed...</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248047#M14228</link>
      <description>&lt;P&gt;Yes, I meant onResume().&amp;nbsp; It works with the example app, so I must have broken something by consolidating everything to one activity and class.&amp;nbsp; I'll look into finding the crucial difference and report back when I have it working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 21:40:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248047#M14228</guid>
      <dc:creator>T3chDad</dc:creator>
      <dc:date>2017-10-19T21:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Android app fails authentication if Dropbox app isn't installed...</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248224#M14237</link>
      <description>&lt;P&gt;Alright...I figured it out.&amp;nbsp; Silly me.&amp;nbsp; I had two Dropbox activity declarations in my manifest.&amp;nbsp; I had the "old" original entry with my production app key (from v1 days) and I had the new v2 api entry with a different app key that I use for testing.&amp;nbsp; Once I removed the old activity entry and changed the key on the new activity entry, everything worked properly.&amp;nbsp; My Dropbox activities in my manifest as they were before the fix are below for reference.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;!-- Old v1 Activity --&amp;gt;&lt;BR /&gt;&amp;lt;activity 
	android:name="com.dropbox.client2.android.AuthActivity"
	android:launchMode="singleTask"
	android:configChanges="orientation|keyboard"&amp;gt;
	&amp;lt;intent-filter&amp;gt;
		&amp;lt;!-- Change this to be db- followed by your app key --&amp;gt;
		&amp;lt;data android:scheme="db-xxxxxxxxxx(CorrectKey)" /&amp;gt;
		&amp;lt;action android:name="android.intent.action.VIEW" /&amp;gt;
		&amp;lt;category android:name="android.intent.category.BROWSABLE"/&amp;gt;
		&amp;lt;category android:name="android.intent.category.DEFAULT" /&amp;gt;
	&amp;lt;/intent-filter&amp;gt;
&amp;lt;/activity&amp;gt;&lt;BR /&gt;&amp;lt;!--New v2 Activity --&amp;gt;
&amp;lt;activity
	android:name="com.dropbox.core.android.AuthActivity"
	android:configChanges="orientation|keyboard"
	android:launchMode="singleTask"&amp;gt;
	&amp;lt;intent-filter&amp;gt;
		&amp;lt;!-- Change this to be db- followed by your app key --&amp;gt;
		&amp;lt;data android:scheme="db-yyyyyyyyyyyyy(WrongKey)" /&amp;gt;
		&amp;lt;action android:name="android.intent.action.VIEW" /&amp;gt;
		&amp;lt;category android:name="android.intent.category.BROWSABLE" /&amp;gt;
		&amp;lt;category android:name="android.intent.category.DEFAULT" /&amp;gt;
	&amp;lt;/intent-filter&amp;gt;
&amp;lt;/activity&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Thanks for your help and patience in getting me pointed in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 14:30:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248224#M14237</guid>
      <dc:creator>T3chDad</dc:creator>
      <dc:date>2017-10-20T14:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Android app fails authentication if Dropbox app isn't installed...</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248236#M14239</link>
      <description>Thanks for following up. I'm glad to hear you sorted this out.</description>
      <pubDate>Fri, 20 Oct 2017 15:00:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Android-app-fails-authentication-if-Dropbox-app-isn-t-installed/m-p/248236#M14239</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-20T15:00:29Z</dc:date>
    </item>
  </channel>
</rss>

