Adjusted some parameter names for api, show toasts on ui thread

pull/14/head
Sam Bosley 12 years ago
parent 70de62ddff
commit 4cb212e941

@ -962,7 +962,7 @@ public final class ActFmSyncService {
String purchaseToken = Preferences.getStringValue(BillingConstants.PREF_PURCHASE_TOKEN);
String productId = Preferences.getStringValue(BillingConstants.PREF_PRODUCT_ID);
try {
actFmInvoker.invoke("premium_update_android", "purchaseToken", purchaseToken, "productId", productId);
actFmInvoker.invoke("premium_update_android", "purchase_token", purchaseToken, "product_id", productId);
Preferences.setBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, false);
if (onSuccess != null)
onSuccess.run();

@ -235,12 +235,22 @@ public class BillingActivity extends Activity {
@Override
public void run() {
Preferences.setBoolean(ActFmPreferenceService.PREF_PREMIUM, true);
Toast.makeText(BillingActivity.this, R.string.premium_success, Toast.LENGTH_LONG).show();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(BillingActivity.this, R.string.premium_success, Toast.LENGTH_LONG).show();
}
});
}
}, new Runnable() {
@Override
public void run() {
Toast.makeText(BillingActivity.this, R.string.premium_success_with_server_error, Toast.LENGTH_LONG).show();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(BillingActivity.this, R.string.premium_success_with_server_error, Toast.LENGTH_LONG).show();
}
});
}
});
}

Loading…
Cancel
Save