Profile

Member Since
February 12, 2012

Search Members

  

mourlamstudios

152
@

Badges

This user hasn't earned any badges yet.

Posts

Viewing 1 to 20 (149 Total)

Re: Google Play In App Purchase (Billing)

Need some help to finish up google play iap. I've got it so in app purchase window opens, shows iap, you can buy it but when it returns to the game, onActivityResult is called on GameActivity, not my custom Test class. I need to access onActivityResult to finalize payment.

Here is Test.java:
http://mourlam-studios.svn.beanstalkapp.com/ashaxeextensions/trunk/...

Yes, my public key for one of my games is in there. Oh well. Just trying to get this puppy finished so we can use it / release extension. My Java is no where near as good as my obj-c.

Am i wrong in the fact that there are no IAP extensions for Google Play or Amazon for haxe/nme yet? If there, i'd love to know and stop pulling my hair out over creating this extensions, if not, this is JUST about there. One function away. Help!

Appreciate any help in advance.

Posted on February 28, 2013 at 1:10 PM

Re: Template path="AndroidManifest.xml" not working?

i'm using this...

<template path="template/android/AndroidManifest.xml" if="android" rename="AndroidManifest.xml"></template>

and it works. manifest is inside template/android (as you can probably see smiling ) so maybe you just need to remove the bin/ in your rename?

Posted on February 28, 2013 at 1:04 PM

Re: Facebook Extension Needs App Delegate

yea that's def the post i got it from. Interesting that it's not firing for you. Where are you calling the module to register your appdelegate "listeners"? From your main.hx (or equivalent?) i.e. I'm calling registerForRemote() to access right after super() inside my Main.hx new() function.

Link to modules if you want to try them out:
http://mourlam-studios.svn.beanstalkapp.com/ashaxeextensions...

Let me know what you find out. Post some code.

Posted on February 28, 2013 at 11:01 AM

Re: Remote push notifications extension

https://mourlam-studios.svn.beanstalkapp.com/ashaxeextensions/trunk/

aspush is what the module you're looking for.
functionality-wise it returned a device token for iOS, allows you to set bad number, local notifications (not completed yet):

var push.AsPusher = new(successFunction,failFunction);

push.registerForRemoteNotifications();

//sample success function
function successFunction(token)
{
trace("Push token " + token);
//upload this token to our server/db so you can push to it later
}

hopefully this is what you're looking for. let me know if you have any questions. We're currently using in Mole Word (free + paid version) for iOS

Posted on February 23, 2013 at 7:57 PM

Re: NME Webview Native Extension

v nice. thank you for this!

Posted on February 23, 2013 at 5:36 PM

Google Play In App Purchase (Billing)

Wrapping up Google Play Billing v3 (In app purchase) for android 2.3.4+ and have a few questions to make it out of the box ready so i can release to public.

Was nice to see Billing AIDL integrate and convert to .java without a hitch.

1) How do I log from inside Java extensions being called by JNI.createStaticMethod? I threw alerts the entire time to debug since I couldn't get any logs out.
Log.i .e .v - none logged to console. Didn't check DDMS yet but would love to see logs go to the standard haxe console.

2) Manifest question. Seeing this:

[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.

i'm assuming I can merge a custom AndroidManifest without users having to modify their own and "template" it in as
com.android.vending.BILLING is required for Play IAP. So just need module to add that permission when including extension.


Will try to release Amazon IAP lib as well. No idea if it will be as simple as Billing had a nice sample with lots of Util functions making billing very simple. Wish I would have done this months ago!

Thanks for any help in advance.

Posted on February 23, 2013 at 5:21 PM

Re: Facebook Extension Needs App Delegate

ps both didRegisterForRemoteNotificationsWithDeviceToken() and didFailToRegisterForRemoteNotificationsWithError() are normally UIApplicationDelegate functions but overridden with above code.

Posted on February 21, 2013 at 6:40 AM

Re: Facebook Extension Needs App Delegate

i had to do this for push notifications in ios. found some code online somewhere but have no idea where (it was hours of searching and tinkering smiling

posting all code so you can see but check out the registerForRemote() function specifically. hope this helps.

#import <UIKit/UIKit.h>
#import <CoreFoundation/CoreFoundation.h>
#include <ctype.h>
#include <objc/runtime.h>
#include "Events.h"

typedef void (*FunctionType)();
extern "C" void aspush_send_event(Event &inEvent);

@interface PushAppDelegate : UIResponder <UIApplicationDelegate>
{

}

@end

@implementation PushAppDelegate

@end

namespace aspush
{
PushAppDelegate *pushDelegate;

void registerForRemote();
void didRegisterForRemoteNotificationsWithDeviceToken(id self, SEL _cmd, UIApplication* application, NSData* deviceToken);
void didFailToRegisterForRemoteNotificationsWithError(id self, SEL _cmd, UIApplication* application, NSError* error);


//custom implementations of empty signatures above
void didRegisterForRemoteNotificationsWithDeviceToken(id self, SEL _cmd, UIApplication* application, NSData* deviceToken)
{
NSString *devToken = [[[[deviceToken description]
stringByReplacingOccurrencesOfString:@"<"withString:@""]
stringByReplacingOccurrencesOfString:@">" withString:@""]
stringByReplacingOccurrencesOfString: @" " withString: @""];

//dispatch our event
Event evt(etREGISTER_TOKEN_SUCCESS);
evt.data = "etREGISTER_TOKEN_SUCCESS";
evt.token = [devToken cStringUsingEncoding:NSASCIIStringEncoding];
aspush_send_event(evt);

NSLog(@"AsPush : Did register with device token: %@",devToken);
}


void didFailToRegisterForRemoteNotificationsWithError(id self, SEL _cmd, UIApplication* application, NSError* error)
{
NSLog(@"AsPush : Failed to register device - %@", [error description]);

//dispatch our event
Event evt(etREGISTER_TOKEN_FAILED);
evt.data = "etREGISTER_TOKEN_FAILED";
evt.token = "FAILED";
aspush_send_event(evt);
}

void registerForRemote()
{
NSLog(@"AsPush :: registering app for remote notifications.");

//Code below found on stack overflow. Fantastic find.

id delegate = [[UIApplication sharedApplication] delegate];

Class objectClass = object_getClass(delegate);

NSString *newClassName = [NSString stringWithFormat:@"Custom_%@", NSStringFromClass(objectClass)];
Class modDelegate = NSClassFromString(newClassName);
if (modDelegate == nil)
{
// this class doesn't exist; create it
// allocate a new class
modDelegate = objc_allocateClassPair(objectClass, [newClassName UTF8String], 0);

SEL selectorToOverride1 = @selector(application:didRegisterForRemoteNotificationsWithDeviceTokensmiling;
SEL selectorToOverride2 = @selector(application:didFailToRegisterForRemoteNotificationsWithErrorsmiling;

// get the info on the method we're going to override
Method m1 = class_getInstanceMethod([PushAppDelegate class], selectorToOverride1);
Method m2 = class_getInstanceMethod([PushAppDelegate class], selectorToOverride2);

// add the method to the new class
class_addMethod(modDelegate, selectorToOverride1, (IMP)didRegisterForRemoteNotificationsWithDeviceToken, method_getTypeEncoding(m1));

class_addMethod(modDelegate, selectorToOverride2, (IMP)didFailToRegisterForRemoteNotificationsWithError, method_getTypeEncoding(m2));

// register the new class with the runtime
objc_registerClassPair(modDelegate);
}
// change the class of the object
object_setClass(delegate, modDelegate);

//Register this app for remote notifications
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge];
}

void scheduleLocalPush()
{
NSLog(@"AsPush : obj_c scheduleLocalPush");
}

void setAppBadge(int num)
{
NSLog(@"AsPush : setAppBadge - %i",num);

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:num];
}
}

Posted on February 21, 2013 at 6:38 AM

Re: Using blocks in native ios modules

Blocks work just fine. Finished up the module last night.

Anyone interested in the social share plugin for nme (ios only)? Share message, url, image via email, text, twitter, facebook like images below...




Posted on February 17, 2013 at 1:15 PM

Using blocks in native ios modules

About to write a quick module to use iOS 6's Social framework (facebook / twitter integration). Random question which i will soon find out the answer but curious if anyone knows if there are any issues with using blocks in NME extensions?

Posted on February 16, 2013 at 5:07 PM

Re: Strange Masks

when you say "it's out" did you submit to apple or get approved? i couldn't find it on the store smiling

Posted on January 11, 2013 at 12:15 AM

Re: Strange Masks

very nice! congrats. Will have to check out legit copy from app store.

PM if you want some advice on ios / mac store. it's nice to see another developer on the mac app sotore.

Posted on January 11, 2013 at 12:14 AM

Re: Async networking support

Added new module to ashaxextensions:

AsURLConnection for iOS

http://mourlam-studios.svn.beanstalkapp.com/ashaxeextensions...

Module allows for async network connections. Very basic at the moment only allowing get variables and simply returns any data returned as string. Enough for us to call our various apis including push and in app game notifications.

Let me know if you need help using it at all but requires one function new AsURLConnection(successFunction,failedFunction) success function uses a Dynamic input with .returnData for incoming.

Posted on January 09, 2013 at 7:30 PM

Re: Async networking support

It's possible that URLLoader IS async but this line of code halts iOS device for up to 2-3 seconds making URLLoader almost useless unless you don't mind 2-3 second lag. We're trying to silently collect data from server. Not happening with current implementation. Please help.

nmeHandle = nme_curl_create (request);

Line 123, native.net.URLLoader.hx

Posted on January 08, 2013 at 8:34 AM

Re: Async networking support

bumping this. anyone?

Posted on January 08, 2013 at 6:49 AM

Re: Music with NME 3.5.3 on iOS

Yea i noticed after posting as well. Empty space was xml tags from .nmml which must be posting as html and stripped from forum entry.

Was supposed to look something like:

*assets path="parent/music_path" rename="music"*
*music path="name.mp3"*
*music path="name.mp3"*
*/assets*

Assets.hx matched exactly what I was asking for including id='music'

Does "music" id'ed assets have streaming optimization compared to standard "sound"s? Curious as we will be submitting Mole Word 2.0 tomorrow!

Any quick tutorials or chats on getting NME up and running on BB10 and/or playbook?? BB world is next up for us. Thx

Posted on January 07, 2013 at 9:35 PM

Re: [iOS] Game shows iOS clock/battery bar

Shouldn't need to update to dev build. Download 3.5.3 (release candidate) from site w/ hxcpp 2.10.3. Use same code as above and you should be good.

Posted on January 07, 2013 at 5:16 PM

Re: Music with NME 3.5.3 on iOS

Another note, I am seeing "music_spyrite_mp3" inside the export/ios/moleword/assets/ folder.

Posted on January 05, 2013 at 11:52 AM

Music with NME 3.5.3 on iOS

Does the following snippet inside project.nmml still work for NME 3.5.3?










When trying to play music the app crashes as it is unable to find music asset:

Assets.hx:897: [nme.Assets] There is no Sound asset with an ID of "music/SpyRite.mp3"

Thanks in advance

Posted on January 05, 2013 at 11:11 AM

Re: [iOS] Game shows iOS clock/battery bar

Was seeing the same thing with 3.5.3 downloaded directly from nme site. fullscreen prop fixed it:

<window orientation="portrait" fps="60" fullscreen="true"/>

Posted on January 05, 2013 at 11:06 AM
« Previous123456...8Next »