Prompt for login at in app billing page, direct users to astrid.com if billing not supported

pull/14/head
Sam Bosley 14 years ago
parent 069a40d4f6
commit e9d1f1391e

@ -52,7 +52,7 @@
won\'t be able to make purchases.</string>
<string name="subscriptions_not_supported_title">Can\'t purchase subscriptions</string>
<string name="subscriptions_not_supported_message">The Market billing
service on this device does not support subscriptions at this time.</string>
service on this device does not support subscriptions at this time. You can subscribe to Astrid Premium at http://astrid.com/premium.</string>
<string name="cannot_connect_title">Can\'t connect to Market</string>
<string name="cannot_connect_message">This app cannot connect to Market.
Your version of Market may be out of date.

@ -44,6 +44,8 @@ public class BillingActivity extends Activity {
private Button buyYear;
@Autowired private ActFmSyncService actFmSyncService;
@Autowired private ActFmPreferenceService actFmPreferenceService;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -60,7 +62,23 @@ public class BillingActivity extends Activity {
ResponseHandler.register(purchaseObserver);
if (!billingService.checkBillingSupported(BillingConstants.ITEM_TYPE_SUBSCRIPTION)) {
// Enforce logged in here? If so, barrier to subscribing, if not, has the possibility of double subscribing.
if (!actFmPreferenceService.isLoggedIn()) {
// Prompt to log in
DialogUtilities.okCancelDialog(this, getString(R.string.premium_login_prompt), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Set result, finish, use callback to prompt for login
}
},
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
} else if (!billingService.checkBillingSupported(BillingConstants.ITEM_TYPE_SUBSCRIPTION)) {
showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID);
} else if (ActFmPreferenceService.isPremiumUser()) {
DialogUtilities.okDialog(this, getString(R.string.premium_already_subscribed), new DialogInterface.OnClickListener() {

Loading…
Cancel
Save