Hi,
I can't find any example for this API version. Why Smartfox don't make demo for it? Please let me know where I can find the example link?
Example for the API?
- A51Integrated
- Posts: 240
- Joined: 03 Jan 2012, 19:55
- Location: Toronto, Canada
- Contact:
Re: Example for the API?
Demo's will be updated shortly. We're actively working on it.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
http://a51integrated.com / +1 416-703-2300
Re: Example for the API?
Thank you for your fast response. Would you please let me know how to implement ISFSEvents? and the -(void)onConnection:(SFSEvent *)evt;??
Best regards
Best regards
- A51Integrated
- Posts: 240
- Joined: 03 Jan 2012, 19:55
- Location: Toronto, Canada
- Contact:
Re: Example for the API?
I your header file, implement ISFSEvents - something like
Then in your implementation, you can listen for the events
Code: Select all
#import <UIKit/UIKit.h>
#import <SFS2XAPI/SmartFox2XClient.h>
@interface ViewController : UIViewController <ISFSEvents>
{
SmartFox2XClient *smartFox;
}
Then in your implementation, you can listen for the events
Code: Select all
-(void)viewDidLoad
{
[super viewDidLoad];
smartFox = [[SmartFox2XClient alloc] initSmartFoxWithDebugMode:YES delegate:self];
[smartFox loadConfig:@"config.xml" connectOnSuccess:YES];
}
-(void)onConnection:(SFSEvent *)evt
{
[smartFox send:[LoginRequest requestWithUserName:@"" password:@"" zoneName:nil params:nil]];
}
Re: Example for the API?
Can I do this:
- Login in the AppDelegate
- Listen ISFSEvents in another Class without relogin?
- Login in the AppDelegate
- Listen ISFSEvents in another Class without relogin?
- A51Integrated
- Posts: 240
- Joined: 03 Jan 2012, 19:55
- Location: Toronto, Canada
- Contact:
Re: Example for the API?
Sure. Just make sure to implement ISFSEvents in your header file.
You can also access your SFS instance like:
assuming that smartFox is a property of the AppDelegate.
You can also access your SFS instance like:
Code: Select all
SmartFox2XClient *smartFox = ((AppDelegate *)[[UIApplication sharedApplication] delegate]).smartFox;
assuming that smartFox is a property of the AppDelegate.
Return to “SFS2X iPhone / iPad / OSX API”
Who is online
Users browsing this forum: No registered users and 37 guests