blueriverinteractive / robovm-ios-bindings Goto Github PK
View Code? Open in Web Editor NEW[Deprecated] New bindings: https://github.com/robovm/robovm-robopods. A collection of third party bindings for RoboVM iOS
License: Apache License 2.0
[Deprecated] New bindings: https://github.com/robovm/robovm-robopods. A collection of third party bindings for RoboVM iOS
License: Apache License 2.0
RoboVm 0.0.11
using newest bindings
libgdx + newest backend that supports new bindings
get the following error when using intersitital ads:
Exception in thread "main" java.lang.ClassCastException: org.robovm.apple.foundation.NSObject cannot be cast to org.robovm.objc.ObjCClass
at org.robovm.objc.ObjCClass.getFromObject(ObjCClass.java)
at org.robovm.objc.ObjCObject.toObjCObject(ObjCObject.java)
at org.robovm.objc.ObjCObject.toObjCObject(ObjCObject.java)
at org.robovm.apple.foundation.NSObject$Marshaler.toObject(NSObject.java)
at org.robovm.bindings.admob.GADInterstitial.$m$presentFromRootViewController$(Native Method)
at org.robovm.bindings.admob.GADInterstitial.present(GADInterstitial.java)
at org.jrenner.superior.ios.ads.IOSAds.showInterstitial(IOSAds.java)
I am running into the following error during runtime....
My Facebook portion look like:
String requestMessage = "http://www.facebook.com/sharer/sharer.php?t=";
FacebookManager facebookManager = FacebookManager.getInstance();
facebookManager.request(requestMessage, HttpMethod.POST, null);
and my imports for Facebook are the following:
import org.robovm.bindings.facebook.HttpMethod;
import org.robovm.bindings.facebook.manager.FacebookManager;
Exception in thread "main" java.lang.ClassCastException: org.robovm.cocoatouch.uikit.UITouch cannot be cast to org.robovm.apple.foundation.NSObject
at org.robovm.apple.foundation.NSObject$Marshaler.toObject(NSObject.java)
at org.robovm.apple.foundation.NSEnumerator.$m$nextObject(Native Method)
at org.robovm.apple.foundation.NSEnumerator.nextObject(NSEnumerator.java)
at org.robovm.apple.foundation.NSEnumerator$Iterator.(NSEnumerator.java)
at org.robovm.apple.foundation.NSMutableSet$SetAdapter$1.(NSMutableSet.java)
at org.robovm.apple.foundation.NSMutableSet$SetAdapter.iterator(NSMutableSet.java)
at org.robovm.cocoatouch.foundation.NSSet.iterator(NSSet.java)
at com.badlogic.gdx.backends.iosrobovm.IOSInput.toTouchEvents(IOSInput.java)
at com.badlogic.gdx.backends.iosrobovm.IOSInput.touchDown(IOSInput.java)
at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.touchesBegan(IOSGraphics.java)
at org.robovm.cocoatouch.uikit.UIResponder$Callbacks.touchesBegan(UIResponder.java)
at org.robovm.cocoatouch.uikit.UIApplication.UIApplicationMain(Native Method)
at org.robovm.cocoatouch.uikit.UIApplication.main(UIApplication.java)
at com.yolo.wordregress.RobovmLauncher.main(RobovmLauncher.java)
Any ideas?
SLComposeViewController twitterController = SLComposeViewController.fromServiceType(SLServiceType.Twitter());
throws an exception
2014-05-11 15:15:32.977 VforVoodooFree[1740:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid service type'
*** First throw call stack:
(0x2d95ffd3 0x3860bccf 0x2ffd5047 0x2ffe1c91 0x2ffe1ceb 0x2ffe2105 0xd1f383 0xd1e953 0xd1e97f 0x5e66b3 0x5e483f 0x5f94b1 0x56be49 0x56b901 0x569d3b 0x56cba7 0x4a8b15 0x4b7939 0x37e56d 0x4b62ad 0x37e425 0x4b66d1 0xfef3b3 0xfe401f 0xfe40bd 0x2e484819 0x2e48592f 0x2fe47df3 0x2fe47b9d 0x32bee75d 0x2e64a451 0x2d91fef9 0x2d92aab7 0x2d92aa53 0x2d929227 0x2d893f0f 0x2d893cf3 0x327c6663 0x301df16d 0xd94e81 0xd940cf 0xd9410f 0x5e690b 0x126cadf 0x126700b 0x1267ed5 0x1264a25 0x125d79d 0x3753d0)
libc++abi.dylib: terminating with uncaught exception of type NSException
Hello,
I've just implemented GAnalytics with robovm bindings. However, I'm unable to set dispatch period because in GAI.java this part is commented:
// @property(nonatomic, assign) NSTimeInterval dispatchInterval;
/*
* private static final Selector setDispatchInterval$ = Selector.register("setDispatchInterval:");
*
* @Bridge private native static void objc_setDispatchInterval(GAI __self__, Selector __cmd__, NSTimeInterval
* dispatchInterval); public void setDispatchInterval(NSTimeInterval dispatchInterval){ objc_setDispatchInterval(this,
* setDispatchInterval$, dispatchInterval); }
*/
Is there a workaround how to set dispatch interval or should i somehow implement my own way how to dispatch data every 20 seconds? (By calling manual dispatch() within my LibGDX game? Default is set to 120 seconds which is too much for me..)
I have tried multiple combinations but my message fields always are state "Write something..." Am i missing something or does this just not work at the moment?
Once called --- with the same parameters as your sample --- the facebook app on my ipad2 launches but always says you are already authorized. I click okay and it takes me back to my app and then shows me a empty dialog for facebook. All i am seeing is a small x in the top left hand corner. Any ideas?
The following code
SLComposeViewController twitterController = SLComposeViewController.fromServiceType(SLServiceType.Twitter());
throws an exception:
2014-05-10 16:41:08.377 VforVoodoo[1560:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid service type'
*** First throw call stack:
(0x2d95ffd3 0x3860bccf 0x2ffd5047 0x2ffe1c91 0x2ffe1ceb 0x2ffe2105 0xd135b3 0xd12b83 0xd12baf 0x5dac63 0x5d8daf 0x5ed6e5 0x5603b9 0x55fe71 0x55e2ab 0x561117 0x49d085 0x4abea9 0x372add 0x4aa81d 0x372995 0x4aac41 0xfe35e3 0xfd824f 0xfd82ed 0x2e484819 0x2e48592f 0x2fe47df3 0x2fe47b9d 0x32bee75d 0x2e64a451 0x2d91fef9 0x2d92aab7 0x2d92aa53 0x2d929227 0x2d893f0f 0x2d893cf3 0x327c6663 0x301df16d 0xd890b1 0xd882ff 0xd8833f 0x5daebb 0x1260d0f 0x125b23b 0x125c105 0x1258c55 0x12519cd 0x369940)
libc++abi.dylib: terminating with uncaught exception of type NSException
May be any hot fixes? Thanks in advance.
Firstly, I have downloaded 19 May nightly RoboVM build, checked out latest BlueRiverInteractive bindings from GitHub and I am not using cocoatouch package :)
throws an exception
[InAppPurchaseManager] Products successfully received!
Exception in thread "main" java.lang.ClassCastException: org.robovm.cocoatouch.foundation.NSArray cannot be cast to org.robovm.apple.foundation.NSObject
at org.robovm.apple.foundation.NSObject$Marshaler.toObject(NSObject.java)
at org.robovm.apple.foundation.NSArray$AsListMarshaler.toObject(NSArray.java)
at org.robovm.apple.storekit.SKProductsResponse.$m$products(Native Method)
at org.robovm.apple.storekit.SKProductsResponse.getProducts(SKProductsResponse.java)
at org.robovm.bindings.inapppurchase.InAppPurchaseManager$RequestDelegate.didReceiveResponse(InAppPurchaseManager.java)
at org.robovm.apple.storekit.SKProductsRequestDelegate$ObjCProxy.$cb$productsRequest$didReceiveResponse$(Unknown Source)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at com.forilab.voodoo.VoodooIOS.main(VoodooIOS.java)
on line number 128: response.getProducts();
I mean that the ONLY fix is to go to org.robovm.apple.storekit.SKProductsResponse class and change returned value type from org.robovm.apple.foundation.NSArray to org.robovm.cocoatouch.foundation.NSArray. Waiting for fix :)
PS. I can provide product info and source code if needed, preferably by email.
This might be an issue with the version of robovm I'm using...
FacebookManager calls NSOperationQueue.getMainQueue().addOperation(
should it be NSOperationQueue.mainQueue().addObserver(
Another question: what happened to the getScore functions? why were they removed?
Replace in the method publishImpl
JSONObject graphResponse = new JSONObject(graphObject);
with:
JSONObject graphResponse = new JSONObject(graphObjectJava);
Hello,sir. I write a .a file like this:
@interface Mymic : NSObject
and in java:
static { ObjCRuntime.bind(Mymic.class); }
private static final Selector testReturnFloat = Selector.register("testReturnFloat");
@Bridge private native static float objc_testReturnFloat(Mymic __self__, Selector __cmd__);
public float testReturnFloat() {
return objc_testReturnFloat(this, testReturnFloat);
}
private static final Selector testReturnInt = Selector.register("testReturnInt");
@Bridge private native static int objc_testReturnInt(Mymic __self__, Selector __cmd__);
public int testReturnInt() {
return objc_testReturnInt(this, testReturnInt);
}
private static final Selector myPrint = Selector.register("myPrint");
@Bridge private native static void myPrint(Mymic __self__, Selector __cmd__);
public void myPrint() {
myPrint(this, myPrint);
}
private static final Selector testInput = Selector.register("testInput");
@Bridge private native static void testInput(Mymic __self__, Selector __cmd__, int num);
public void testInput(int num) {
testInput(this, testInput, num);
}
but the testInput cannot be invoke. can you tell me how to fix it ? thank you .
I try to run following sample https://github.com/BlueRiverInteractive/robovm-ios-bindings/blob/master/messageui/src/org/robovm/apple/messageui/sample/Sample.java
But it throws an exception
Exception in thread "main" java.lang.ClassCastException: org.robovm.cocoatouch.foundation.NSObject cannot be cast to org.robovm.objc.ObjCProtocol
at org.robovm.objc.ObjCObject$Marshaler.protocolToObject(ObjCObject.java)
at org.robovm.apple.uikit.UIViewController.$m$super$transitionCoordinator(Native Method)
at org.robovm.apple.uikit.UIViewController.transitionCoordinator(UIViewController.java)
at org.robovm.apple.uikit.UIViewController.$cb$transitionCoordinator(UIViewController.java)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at com.forilab.voodoo.VoodooIOS.main(VoodooIOS.java)
Hi,
I'm not able to receive a GPS position via CoreLocation binding. Setup, startUpdatingHeading() and all other method calls work flawlessly. But the delegate methods for position updates are never called.
The popup "Allow Application access your position" is also not shown, it seems that the native LocationManager never really starts watching the position.
Tested on an iPhone 5, iPod Touch and in the simulator.
What I did:
Copied the package org.robovm.cocoatouch.corelocation in my LibGDX RoboVM project.
Added the following to the Info.plist.xml:
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
and added CoreLocation to the frameworks section of robovm.xml:
<framework>CoreLocation</framework>
Any idea, or small working configuration example?
Thx!
I am trying to display an admob intestitial ad using latest robovm & robovm-ios-bindings with libgdx-nightly-20140405. There are some issues and forum posts about admob interstitial but it seems that people are having difficulties with displaying adview where I am having problem with loading it. My game does not get any errors and keeps working fine but ads are not getting loaded or errors. None of the delegate methods are triggered so I am not at the display step yet. For now, all I want is one of did
methods of delegate to be triggered :)
PS: I can display ad using Sample.java
Here is my code
public class RobovmLauncher extends IOSApplication.Delegate {
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
config.orientationLandscape = false;
config.orientationPortrait = true;
config.allowIpod = true;
return new IOSApplication(new GdxGame(), config);
}
public static void main(String[] argv) {
NSAutoreleasePool pool = new NSAutoreleasePool();
UIApplication.main(argv, null, RobovmLauncher.class);
pool.close();
}
@Override
public boolean didFinishLaunching(UIApplication application, NSDictionary launchOptions) {
System.out.println("didFinishLaunching...");
boolean res = super.didFinishLaunching(application, launchOptions);
final GADInterstitial interstitial = new GADInterstitial();
interstitial.setAdUnitID("ca-app-pub-9430411208134016/3931947478");
interstitial.setDelegate(new GADInterstitialDelegateAdapter() {
@Override
public void didReceiveAd (GADInterstitial ad) {
System.out.println("didReceiveAd");
// interstitial.present(UIApplication.getSharedApplication().getKeyWindow().getRootViewController());
}
@Override
public void didFailToReceiveAd (GADInterstitial ad, GADErrorCode error) {
System.out.println("didFailToReceiveAd");
}
@Override
public void willPresentScreen (GADInterstitial ad) {
System.out.println("willPresentScreen");
}
@Override
public void willDismissScreen (GADInterstitial ad) {
System.out.println("willDismissScreen");
}
@Override
public void didDismissScreen (GADInterstitial ad) {
System.out.println("didDismissScreen");
}
@Override
public void willLeaveApplication (GADInterstitial ad) {
System.out.println("willLeaveApplication");
}
});
System.out.println("loading request...");
interstitial.loadRequest(GADRequest.request());
return res;
}
}
Here is the console output
didFinishLaunching...
[debug] IOSApplication: View: Portrait 640x1136
[debug] IOSGraphics: 640.0x1136.0, 2.0
[debug] IOSGraphics: Calculating density, UIScreen.mainScreen.scale: 2.0
[debug] IOSGraphics: Display: ppi=326, density=2.0
[debug] IOSApplication: created
loading request...
2014-04-19 13:06:36.139 Double Up[292:60b] <Google> To get test ads on this device, call: request.testDevices = @[ @"db4b1b1f6e85bab414905c3cc8ad5977" ];
[debug] IOSApplication: resumed
Hi,
Could you possibly say what version of the iOS library is being used in the binding?
I would really like to start using the App Events in iOS
https://developers.facebook.com/docs/ios/app-events/
Cookie
I cannot seem to get the admob ads to work on the simulator. I keep getting:
To get test ads on this device, call: request.testDevices = @[ GAD_SIMULATOR_ID ];
Is this normal? Unfortunately I don't have an iOS device handy to test this on a physical device. Everything seems to load properly except I get that one error. I am using the latest admob bindings from github & latest version of robovm. Any help would be appreciated.
I have the following code running:
public void initializeAds() {
if (!adsInitialized) {
log.debug("Initalizing ads...");
adsInitialized = true;
adview = new GADBannerView(GADAdSizeManager.smartBannerPortrait());
adview.setAdUnitID(Constants.ADMOB_KEY);
adview.setRootViewController(iosApplication.getUIViewController());
final GADRequest request = GADRequest.request();
if (Constants.TEST_DEVICE_ENABLED) {
final NSArray<?> testDevices = new NSArray<NSObject>(
new NSString(GADRequest.GAD_SIMULATOR_ID));
request.setTestDevices(testDevices);
log.debug("Test devices: " + request.getTestDevices());
}
adview.loadRequest(request);
log.debug("Initalizing ads complete.");
}
}
Here are the log outputs:
[debug] com.oporko.bff.IOSApplication: Initalizing ads...
[debug] com.oporko.bff.IOSApplication: Test devices: (
Simulator
)
2014-04-09 20:00:56.484 IOSApplication[3460:70b] To get test ads on this device, call: request.testDevices = @[ GAD_SIMULATOR_ID ];
[debug] com.oporko.bff.IOSApplication: Initalizing ads complete.
There's no way to display any sort of ads using the tapjoy bindings. Can you please add in those features?
Hi, I want to use facebook robovm to post a photo (byte array type) to user's wall. Can you show me how to do that? Many thanks.
Thanks @RelaxFactor for updating bindings so quickly!
It appears that the Google Play Game Services bindings were updated at ec84dd1 and 89f6895, however, the libraries in the sample project were deleted at de3c363:
GooglePlus.a
GoogleOpenSource.a
PlayGameServices.a
Could someone direct me to a tutorial on how to generate these archives? I tried a couple of tutorials for creating Static Libraries in Xcode, but was unsuccessful. Please excuse my ignorance on all-things iOS.
Hello,
I am looking to implement the real time multiplayer functionality of gameCenter into my app. I'm curious if any headway has been made in this region? I am trying to get a feel for the amount of work involved before I dive in.
I've implemented Google Play Services Real time multiplayer on the android side and it was surprisingly very easy to implement. Hoping for the same experience here.
Assuming that I complete it successfully, I'll post a merge request to the gamecenter project. I appreciate any pointers or tips.
The latest Facebook SDKs (currently 3.14.1) have deprecated the basic_info permission and replaced it with public_profile and public_friends. Any new Facebook app registered from May 2014 cannot use the basic_info permission anymore. The current bindings only support the old basic_info permission and not the new public_profile permission.
Using the current version of the bindings and requesting basic_info still seems to work if the Facebook app is installed. However, if the app isn't installed (e.g. in the Simulator) an error is displayed (Facebook WebView) to say basic_info is deprecated.
Requested the bindings to be brought up-to-date with the SDK to resolve the conflict.
I got this message when I tried to test admob bindings on simulator.
<Google> To get test ads on this device, call: request.testDevices = @[ GAD_SIMULATOR_ID ];
Here's the code.
@Override
public void didFinishLaunching(UIApplication application) {
rootViewController = new UIViewController();
GADBannerView banner = new GADBannerView(GADAdSizeManager.banner());
banner.setAdUnitID("DUMMY");
banner.setRootViewController(rootViewController);
NSArray<NSString> testDevices = new NSArray<>(new NSString(GADRequest.GAD_SIMULATOR_ID));
GADRequest request = GADRequest.request();
request.setTestDevices(testDevices);
window = new UIWindow(UIScreen.getMainScreen().getBounds());
window.setRootViewController(rootViewController);
window.makeKeyAndVisible();
banner.loadRequest(request);
}
So how to set test devices and show ads?
It would be really useful to add a reference to which library version has each of the bindings been created/tested upon. I haven't been able to find this information, please correct me if I've missed it.
For instance, Chartboost bindings appears to be for version 3.2.1 even if 3.3.1, 4.0 and 4.1 have already been released (I know about the issue with JNI libraries robovm/robovm#263).
Having this information would be great both to keep them up to date by the community as well as making it easier to refer to the appropriate documentation for the specific version when developing.
I implemented the in-app purchase binding to my libgdx game for purchasing ads-free. But, when I was testing purchase restore function. I met this problem :
when user changed device and try to restore previously purchase, the apple ID alert appeared asking user to input his password. When user pressed cancle button or input wrong password, the purchase restoration can not be completed (There is no problem here).However after that, when the user try to purchase an item again and invoke the function :
// First request the available products from the app store.
iapManager.requestProducts("itemID");
// At any time you want to purchase a product.
if (iapManager.canMakePayments() && appStoreProducts != null) {
iapManager.purchaseProduct(appStoreProducts.get("itemID"));
}
The user is unable to start purchasinga again and From the Log TAG,
I got this messsage:
<In-app-puchase Manager> Already purchasing a product!
Checking your source code of InAppPurchaseManager, I found this :
/** Restore any transactions that occurred for this Apple ID. */
public void restoreTransactions () {
if (purchasingProduct) {
System.out.println(TAG + "Already purchasing a product!");
return;
}
System.out.println(TAG + "Restoring products...");
SKPaymentQueue.getDefaultQueue().restoreCompletedTransactions();
purchasingProduct = true;
}
the flag purchasingProduct is set to true no matter whether the purchase restoration was completed or not so that the user is unable to start purchasing a product under the condition that
if (purchasingProduct) {
System.out.println(TAG + "Already purchasing a product!");
return;
}
The souce code of your purchasing function :
/** Purchase the specified product. Should be preceded by a call to {@link #canMakePayments()} to check if the user can buy.
*
* @param product The product to buy. */
public void purchaseProduct (SKProduct product) {
if (purchasingProduct) {
System.out.println(TAG + "Already purchasing a product!");
return;
}
System.out.println(TAG + "Purchasing product '" + product.getLocalizedTitle() + "'...");
SKPayment payment = SKPayment.fromProduct(product);
SKPaymentQueue.getDefaultQueue().addPayment(payment);
purchasingProduct = true;
}
So I recommend that the result of purchase restoration should be checked, if restoration failed, the flag purchasingProduct should be set to False.
My game will be released in one week, I hope you could fix this issue soon.
I am trying to load ads using robovm-admobe bindings in my libgdx game applicaiton. I can get the interstitial ads successfully everytime. However, when I turned internet off and try to load Requst again , call the function
showAds();
I got the following exception
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.robovm.rt.VM.allocateObject(Native Method)
at org.robovm.objc.ObjCObject.toObjCObject(ObjCObject.java)
at org.robovm.objc.ObjCObject.toObjCObject(ObjCObject.java)
at org.robovm.apple.foundation.NSObject$Marshaler.toObject(NSObject.java)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at com.retroidinteractive.cowdash.IOSLauncher.main(IOSLauncher.java)
Caused by: java.lang.IllegalArgumentException: No @org.robovm.rt.br.annotation.Library annotation found on class org.robovm.bindings.admob.GADRequestError
at org.robovm.rt.bro.Runtime.resolveGlobalValue(Runtime.java)
at org.robovm.rt.bro.Bro.bind(Bro.java)
at org.robovm.objc.ObjCRuntime.bind(ObjCRuntime.java)
at org.robovm.bindings.admob.GADRequestError.<clinit>(GADRequestError.java)
... 7 more
My code is :
public class IOSLauncher extends IOSApplication.Delegate{
private UIViewController rootViewController;
private UIViewController subview;
@Override
public boolean didFinishLaunching (UIApplication application,NSDictionary launch Options)
{
super.didFinishLaunching(application, launchOptions);
rootViewController = application.getKeyWindow().getRootViewController();
return false;
}
protected void showAds(){
if(subview == null);
subview = new UIViewController();
GADInterstitial interstitial = new GADInterstitial();
interstitial.setAdUnitID("ad-unit-id");
UIApplication.getSharedApplication().getKeyWindow().setRootViewController(subview);
interstitial.setDelegate(new GADInterstitialDelegateAdapter() {
@Override
public void didReceiveAd (GADInterstitial ad) {
super.didReceiveAd(ad);
System.out.println("Did receive ad.");
ad.present(subview);
}
@Override
public void didFailToReceiveAd (GADInterstitial ad, GADRequestError error) {
super.didFailToReceiveAd(ad, error);
System.out.println("Failed to load Ads");
}
@Override
public void didDismissScreen(GADInterstitial ad) {
super.didDismissScreen(ad);
UIApplication.getSharedApplication().getKeyWindow().setRootViewController(rootViewController);
}
});
interstitial.loadRequest(GADRequest.request());
}
}
What I found is that, when the ads failed to be loaded, the overrided method " didFailToReceiveAd" has never been called but generating the java.lang.IllegalArgumentException above.
Thus, when the ads failed loading (request error occured), it is supposed to be passed to the didFailToReceived method, but this exception crashes my whole application.
I think there must be something wrong with the "GADRequstError" in the implementation of admob robovm bindings. Can someone help with this issue ?
Hello,
I have a problem with google analytics. My tracking code is not sending any data (tested with realtime and also checked on the next day). It worked in previous versions and I have updated my libs properly.
As there is no sample to check against, I will post my code here and if I'm doing something wrong please point it out. Maybe somebody could share their working tracking code?
Thanks.
public class IOSAnalyticsClient implements GoogleAnalyticsClient {
private String id;
private GAIDefaultTracker tracker;
public IOSAnalyticsClient(String id) {
this.id = id;
}
@Override
public void startSession() {
GAI.getSharedInstance().setDryRun(false);
GAI.getSharedInstance().setDispatchInterval(20.0);
tracker = GAI.getSharedInstance().getTracker(id);
}
@Override
public void stopSession() {
try {
tracker.dispose();
} catch (Throwable e) {
e.printStackTrace();
}
}
@Override
public void trackEvent(String category, String action, String label, long value) {
tracker.send(GAIDictionaryBuilder.createEvent(category, action, label, NSNumber.valueOf(value)).build());
}
@Override
public void trackPageView(String name) {
tracker.set("kGAIScreenName", name);
tracker.send(GAIDictionaryBuilder.createAppView().build());
}
@Override
public void trackTiming(String category, long timeInMilliseconds, String name, String label) {
tracker.send(GAIDictionaryBuilder.createTiming(category, NSNumber.valueOf(timeInMilliseconds), name, label).build());
}
@Override
public void trackException(String description, Throwable t, boolean fatal) {
tracker.send(GAIDictionaryBuilder.createException(description, fatal).build());
}
@Override
public void dispatch() {
//System.out.println("dispatching");
GAI.getSharedInstance().dispatch();
}
}
Exception in thread "main" java.lang.ClassCastException: org.robovm.cocoatouch.foundation.NSArray cannot be cast to org.robovm.apple.foundation.NSObject
at org.robovm.apple.foundation.NSObject$Marshaler.toObject(NSObject.java)
at org.robovm.apple.foundation.NSArray$AsListMarshaler.toObject(NSArray.java)
at org.robovm.apple.storekit.SKProductsResponse.$m$products(Native Method)
at org.robovm.apple.storekit.SKProductsResponse.getProducts(SKProductsResponse.java)
at org.robovm.bindings.inapppurchase.InAppPurchaseManager$RequestDelegate.didReceiveResponse(InAppPurchaseManager.java)
at org.robovm.apple.storekit.SKProductsRequestDelegate$ObjCProxy.$cb$productsRequest$didReceiveResponse$(Unknown Source)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at com.forilab.voodoo.VoodooIOS.main(VoodooIOS.java)
Please open your terminal and go to the main directory of
robovm-ios-bindings/
, then run the following command :
gradle admob:build
it will generate the following compile error
robovm-ios-bindings/admob/src/org/robovm/bindings/admob/GADRequestError.java:15: error: no suitable constructor found for NSError()
private GADRequestError () {
^
constructor NSError.NSError(String,long,NSDictionary<NSString,?>) is not applicable (actual and formal argument lists differ in length)
constructor NSError.NSError(SkipInit) is not applicable
(actual and formal argument lists differ in length)
robovm-ios-bindings/admob/src/org/robovm/bindings/admob/GADRequestError.java:19: error: cannot find symbol
long code = code();
^
symbol: method code()
location: class GADRequestError
2 errors
:admob:compileJava FAILED
I got this error after updating to the latest version of RoboVM for Eclipse
Name : RoboVM for Eclipse
Version : 0.0.13.201405140003
As my libgdx project was build on Admob robovm binding project, the above compilation error prevent my robovm project from compiling and running because of unresovlable reference error.
i created an interface named PurchaseManger in Main Project then Created a class in Robovm project implementing PurchaseManger to get call backs from main project . Code is below :
public class PurchaseManagerIos extends UIApplicationDelegate.Adapter implements PurchaseManager {
RobovmLauncher launcher;
private InAppPurchaseManager iapManager;
private Map<String, SKProduct> appStoreProducts;
public PurchaseManagerIos(RobovmLauncher launcher) {
this.launcher=launcher;
}
@OverRide
public void didFinishLaunching(UIApplication application) {
iapManager = new InAppPurchaseManager(new InAppPurchaseListener() {
@OverRide
public void productsReceived(SKProduct[] products) {
// Store the products.
appStoreProducts = new HashMap<String, SKProduct>();
for (int i = 0; i < products.length; i++) {
appStoreProducts.put(products[i].getProductIdentifier()
.toString(), products[i]);
}
System.out.println("product received");
// Fill your shop UI with products here.
}
@Override
public void productsRequestFailed(SKRequest request, NSError error) {
// Something went wrong. Possibly no Internet connection.
System.out.println("No internet");
}
@Override
public void transactionCompleted(SKPaymentTransaction transaction) {
// Purchase successfully completed.
// Get the product identifier and award the product to the user.
String productId = transaction.getPayment()
.getProductIdentifier().toString();
if (productId.equals("com.appster.inapptest.coinpurchase")) {
// awardProduct1();
}
// else if (productId.equals("com.business.game.nonconsumable"))
// {
// // awardProduct2();
// }
System.out.println("transaction Completed");
}
@Override
public void transactionFailed(SKPaymentTransaction transaction) {
// Something went wrong. Possibly no Internet connection.
}
@Override
public void transcationRestored(SKPaymentTransaction transaction) {
// Purchase successfully restored.
// Get the product identifier and award the product to the user.
// This is only useful for non-consumable products.
String productId = transaction.getPayment()
.getProductIdentifier().toString();
// if (productId.equals("com.business.game.nonconsumable")) {
// // awardProduct2();
// }
}
});
// First request the available products from the app store.
iapManager.requestProducts("com.appster.inapptest.coinpurchase");
// When you want to restore products like Ad-free.
iapManager.restoreTransactions();
System.out.println("did finish launching");
}
@OverRide
public void purcahseProduct() {
System.out.println("purchase manager");
// At any time you want to purchase a product.
if (iapManager.canMakePayments())
iapManager.purchaseProduct(appStoreProducts
.get("com.appster.inapptest.coinpurchase"));
}
}
I was expecting a call on didFinishLaunching when an object of PurchaseMangerIos is created from MainActivity but i am not getting any calls on didFinishLaunching .
I am wondering from where i will get the call to didFinishLaunching(UIApplication application) or if going in the wrong direction ??
Hi Guys ,
So i found this binding of ios Inapp but with very thin documentation. Can you please elaborate a little what to do with sample class and flow .
cheers
Hi,
i added building the bindings to the build server, see http://libgdx.badlogicgames.com/robovm-ios-bindings/ and http://libgdx.badlogicgames.com:8080/job/robovm-ios-bindings/
Once you pull in #60 i will point the build server to this main repository.
The generated jar files should contain the robovm.xml and native libraries. Users should only need to add the jar files to their iOS project and RoboVM should do the test (according to this issue robovm/robovm#132)
ciao,
Mario
hi,I want to know do you have any plans about Inmobi bindings?
Thank you for the robovm-ios-bindings project
I'm confused on how to set the adsize using the admob binding. I have the interstitial ads running perfectly and I believe I have everything set up correctly for the banner ad but the problem is that I can't set an ad size.
The parameter says that it takes a GADAdSizeManager but all the different ad sizes are of type GADAdSize. So basically I can't set an ad size. What am I missing? Or is it something you're working on?
Hi,
I'm kind of struggling to get OpenKit working in my project maybe due to a bug. Some sample code would make that clear, but unfortunately no sample is provided.
Currently, I'm struggling to show the login screen. My app crashes with the following error: [OKLoginView initWithTitle:description:login:cancel:]: unrecognized selector sent to instance 0x16694970.
Googling indicates that this can be a bug (http://stackoverflow.com/questions/10784207/uilabel-copywithzone-unrecognized-selector-sent-to-instance)
Quote from link: "On further investigation, it turns out that name title was causing the issue. I had the label declared as IBOutlet UILabel *title; As soon as I changed the name to gtitle, everything worked as expected."
Other quote from link: 'title' causes a problem because you were in a 'UIViewController' subclass. The 'UIViewController' class already has a member title.
Can somebody please confirm whether or not this is a bug. If not, some sample code would facilitate the debugging process on my end, and for many other presumingly as well.
Thanks a lot.
cheers,
Leon
Hello!
I just updated to the newest version of the bindings. Now after adding the google play game services when I try use the HttpURLConnection class to fetch something from an https encrypted connection in my own code the app crashes with the Unexpected response from debugserver: $X00#00 error. Without the google play games services everything works as expected without a crash. When I resymbolicate the crash report from the iphone i get the output below.
My best guess is that when loading the C++ lib which is needed for the google play binding some linking goes wrong. I am quite stuck here because of my limited knowledge of C++ and roboVM.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000009c
Triggered by Thread: 20
Thread 20 Crashed:
0 AgentRun 0x00bbc1f6 ssl23_connect + 94
1 AgentRun 0x0010fbe8 Java_org_apache_harmony_xnet_provider_jsse_NativeCrypto_SSL_1do_1handshake + 280
2 AgentRun 0x006da640 org_apache_harmony_xnet_provider_jsse_NativeCrypto_SSL$5Fdo$5Fhandshake__ILjava_io_FileDescriptor$3BLorg_apache_harmony_xnet_provider_jsse_NativeCrypto$24SSLHandshakeCallbacks$3BIZ$5BB__I + 80
3 AgentRun 0x006da6a2 org_apache_harmony_xnet_provider_jsse_NativeCrypto_SSL$5Fdo$5Fhandshake__ILjava_io_FileDescriptor$3BLorg_apache_harmony_xnet_provider_jsse_NativeCrypto$24SSLHandshakeCallbacks$3BIZ$5BB__I_clinit + 70
4 AgentRun 0x006e387c org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl_startHandshake__V + 1332
5 AgentRun 0x006e3ba6 org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl_startHandshake__V_synchronized + 102
6 AgentRun 0x00662504 javax_net_ssl_SSLSocket_startHandshake__V_lookup + 40
7 AgentRun 0x00683340 libcore_net_http_HttpConnection_setupSecureSocket__Ljavax_net_ssl_SSLSocketFactory$3BZ__V + 236
8 AgentRun 0x0068809c libcore_net_http_HttpsURLConnectionImpl$24HttpsEngine_makeSslConnection__Z__Z + 128
9 AgentRun 0x00687fd0 libcore_net_http_HttpsURLConnectionImpl$24HttpsEngine_connect__V + 140
10 AgentRun 0x006859f2 libcore_net_http_HttpEngine_connect__V_lookup + 38
11 AgentRun 0x006848f2 libcore_net_http_HttpEngine_sendSocketRequest__V + 26
12 AgentRun 0x00684770 libcore_net_http_HttpEngine_sendRequest__V + 232
13 AgentRun 0x0068686e libcore_net_http_HttpURLConnectionImpl_getResponse__Llibcore_net_http_HttpEngine$3B + 278
14 AgentRun 0x0068611c libcore_net_http_HttpURLConnectionImpl_getHeaderField__Ljava_lang_String$3B__Ljava_lang_String$3B + 92
15 AgentRun 0x005b0c7e java_net_URLConnection_getHeaderField__Ljava_lang_String$3B__Ljava_lang_String$3B_lookup + 38
16 AgentRun 0x005b00d0 java_net_URLConnection_getHeaderFieldInt__Ljava_lang_String$3BI__I + 100
17 AgentRun 0x005b0cfc java_net_URLConnection_getHeaderFieldInt__Ljava_lang_String$3BI__I_lookup + 52
18 AgentRun 0x005afd10 java_net_URLConnection_getContentLength__I + 32
19 AgentRun 0x005b0aba java_net_URLConnection_getContentLength__I_lookup + 38
20 AgentRun 0x006879b6 libcore_net_http_HttpsURLConnectionImpl_getContentLength__I + 18
21 AgentRun 0x005b0aba java_net_URLConnection_getContentLength__I_lookup + 38
Hi,
Is there anything the pipeline to update the bindings for GPGS to support real time multi-player?
https://developers.google.com/games/services/ios/realtimeMultiplayer
Hi guys, I have create Nativex binding, how can I make it public?
i can not get the transactionReceipt
When I try to login to game center I get this error message
26/03/14 6:16:24 PM: [ERROR] AppLauncher failed with an exception:
26/03/14 6:16:24 PM: [ERROR] java.lang.RuntimeException: Unexpected response from debugserver: $X00#00
26/03/14 6:16:24 PM: [ERROR] at org.robovm.libimobiledevice.util.AppLauncher.launchInternal(AppLauncher.java:695)
26/03/14 6:16:24 PM: [ERROR] at org.robovm.libimobiledevice.util.AppLauncher.launch(AppLauncher.java:801)
26/03/14 6:16:24 PM: [ERROR] at org.robovm.compiler.target.ios.AppLauncherProcess$1.run(AppLauncherProcess.java:67)
Here's the code I use to execute the Game Center
public boolean didFinishLaunching (UIApplication application, NSDictionary launchOptions) {
final boolean result = super.didFinishLaunching(application, launchOptions);
System.out.println("Launched");
manager = new GameCenterManager(app.getUIViewController().getView().getWindow(), this);
//manager.login();
return result;
}
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
config.orientationLandscape = true;
config.orientationPortrait = false;
isLoggedIn = false;
fullScreen = new GADInterstitial();
fullScreen.setAdUnitID(INTERSTITIAL_AD_UNIT_ID);
fullScreen.setDelegate(this);
fullScreen.loadRequest(new GADRequest());
app = new IOSApplication(new MyApp(this, this), config);
//super.didFinishLaunching(UIApplication.getSharedApplication());
return app;
}
I've also tried this but it didn't change anything:
manager = new GameCenterManager(UIApplication.getSharedApplication().getKeyWindow(), this);
Undefined symbols for architecture i386:
14-4-12 20:28:26: [ERROR] "OBJC_CLASS$_CTTelephonyNetworkInfo", referenced from:
14-4-12 20:28:26: [ERROR] objc-class-ref in libadmob.a(GADDevice.o)
14-4-12 20:28:27: [ERROR] ld: symbol(s) not found for architecture i386
14-4-12 20:28:27: [ERROR] clang: error: linker command failed with exit code 1 (use -v to see invocation)
14-4-12 20:28:27: [ERROR] Build failed
Hi,
I've seen the sample code for CoreLocation, it works so far. But why are the bindings to CLLocationCoordinate2D coord = loc.coordinate() not working? Calling the getter causes a crash. This is why the toString() of CLLocation is parsed.
Does anyone know why this causes the app to crash? Is this a known issue - the binding looks ok to me?
Thx
App crashes with NoSuchMethodError for getDelegate() in Chartboost class. This happens only if I use setDelegate(...).
Adding getDelegate() property fixes the problem.
Calling the method
manager.showLeaderboard(leaderboardId)
shows the leaderboard and if the user presses done everything works as expected. The problem is that when the user press the back button (the one that leads to the list of leaderboards) the app crashes with the following error:
[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]'
the problems seems to be here: GPGLeaderboardScoresViewController fetchSocialScores but I'm unable to trace it.
If I use manager.showLeaderboardsPicker() everything works fine.
Replace
NSDictionary<NSObject, NSObject> graphUser = (NSDictionary<NSObject, NSObject>)((NSMutableDictionary<NSObject, NSObject>)result).get(new NSString("data"));
with:
NSDictionary<NSObject, NSObject> graphUser = (NSDictionary<NSObject, NSObject>)(result);
In FacebookManager at the method getProfile (final ProfileRequestListener profileRequestListener)
Yesterday I updated my bindings as I was getting ready to submit for review but keep getting the error below. It used to work before the StoreKit merge. I tried looking for several hours but didn't see any change in my app side.
Exception in thread "main" java.lang.AbstractMethodError: org.robovm.bindings.inapppurchase.InAppPurchaseManager$RequestDelegate.didReceiveResponse(Lorg.robovm.apple.storekit.SKProductsRequest;Lorg.robovm.apple.storekit.SKProductsResponse;)V
at org.robovm.apple.storekit.SKProductsRequestDelegate$ObjCProxy.$cb$productsRequest$didReceiveResponse$(Unknown Source)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
Are you plan for SQLite binding ?
About Admob ,if there is no network,some mistakes will happen.
java.lang.IllegalArgumentException: No constant with value 408383680 (0x185770c0) found in org.robovm.bindings.admob.GADErrorCode
at org.robovm.rt.bro.ValuedEnum$AsLongMarshaler.toObject(ValuedEnum.java)
at org.robovm.rt.bro.ValuedEnum$AsSignedIntMarshaler.toObject(ValuedEnum.java)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at me.hypertext.local.jiong2.RobovmLauncher.main(RobovmLauncher.java)
I modified "GADInterstitialDelegate"
@method(selector = "interstitial:didFailToReceiveAdWithError:")
void didFailToReceiveAd (GADInterstitial ad, int error); not GADErrorCode error
to solve the problem temporary.
None of these work properly:
GADBannerView banner = new GADBannerView(GADAdSizeManager.banner());
GADBannerView banner = new GADBannerView(GADAdSizeManager.getFullWidthPortrait(50));
GADAdSize size = GADAdSizeManager.getGADAdSize(new CGSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() / 10));
GADBannerView banner = new GADBannerView(size);
I always get an error that's something like
Unable to set adSize property with GADAdSize: {6.8093366e-37, 0}, 27d7b7c0. Please use one of the standard ad sizes or create a custom ad size using GADAdSizeFromCGSize.
So what is the proper way to create a banner, using the Admob bindings?
How do I display ads using the flurry binding? The sample doesn't show how to do that, it's very vague.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.