Below is my code in my library. My app is closing unexpectedly when the callback methods (getUpdatePoints and getUpdatePointsFailed) are executed. These callbacks are a result of calling TapjoyConnect.getTapjoyConnectInstance().getTapPoints(this);
Can someone tell me what I am doing wrong? Thanks.
Can someone tell me what I am doing wrong? Thanks.
B4X:
package com.tapjoy;
import android.app.Activity;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.Permissions;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
@Permissions(values={"android.permission.INTERNET", "android.permission.ACCESS_WIFI_STATE", "android.permission.READ_PHONE_STATE", "android.permission.ACCESS_NETWORK_STATE", "android.permission.WRITE_EXTERNAL_STORAGE"})
@ShortName("TapJoy")
@Version(1.0f)
public class TapJoy extends Activity implements TapjoyNotifier {
private BA myba;
private Integer SpendAmount;
private TapjoySpendPointsNotifier notifier;
private TapjoyNotifier notifier1;
/**
* Send the registration to TapJoy
*/
public void RegisterTapJoy() {
TapjoyConnect.requestTapjoyConnect(BA.applicationContext.getApplicationContext(), "dcb1e0a8-3e10-474f-b0b4-5d83b10d972e", "iC4cYd6oDdXYREnKUugs");
}
/**
* Show OfferWall
*/
public void ShowOfferWall() {
TapjoyConnect.getTapjoyConnectInstance().showOffers();
}
public void CallTapPoints(final BA ba) {
myba = ba;
TapjoyConnect.getTapjoyConnectInstance().getTapPoints(this);
}
@Override
public void getUpdatePoints(String currencyName, int pointTotal) {
String PassCurrency = currencyName;
int PassTotal = pointTotal;
myba.raiseEvent(this, "tapjoyget_result", new Object[] { PassCurrency, PassTotal });
}
@Override
public void getUpdatePointsFailed(String error) {
String Passerror = error;
myba.raiseEvent(this, "tapjoyget_error", new Object[] { Passerror });
}
}