iOS Nextpeer facebook integration issue - ios

I am trying to integrate Facebook with Nextpeer. When i tell nextpeer about successful login by these methods:
[Nextpeer loginWithFacebook];
[Nextpeer logoutFromFacebook];
I gives me warning on console
Nextpeer warning: Couldn't login Facebook user - no instance of NPFacebookBridgeDelegate provided.
I have also provided implementation for delegate methods of NPFacebookBridgeDelegate which are:
-(NPFacebookSession*) getCurrentFacebookSession;
-(void) destroyCurrentFacebookSession;
-(void) requestFacebookSessionWithPermissions:(NSArray*)permissions completionBlock:(void (^)(NPFacebookSession* session))completionBlock;
-(void) requestFacebookPermissions:(NSArray*)permissions completionBlock:(void (^)(NPFacebookSession* session))completionBlock;
but these never gets called. Anyone have any idea what am I missing?
Thanks

You missed passing the NextpeerFacebookBridgeDelegate in the initializion phase, as the log said.
Read more here https://nextpeer.atlassian.net/wiki/display/NS/Facebook+Integration

Thanks.. I did it by changing init of nextpeer from
[Nextpeer initWithProductKey:];
To this:
[Nextpeer initializeWithProductKey:GAME_KEY andDelegates:[NPDelegatesContainer containerWithNextpeerDelegate:self tournamentDelegate:self facebookBridgeDelegate:self] ];

Related

How to go to specific native view controller from react-native code?

I'm a newbie in react-native. I'm adding one feature in react-native to an existing swift application. I presented the RCTRootview from my native view controller. From there when user clicks on back button I have to go to Homepage which is written in swift. How do I communicate from react-native to native application code. Can someone please help me with this scenerio. I stuck at this point from last 2 days. Thanks in advance.
Yes. I found out the answer for this. It is all possible with RCTBridgeModule. This piece of code illustrate how to do that.
#import "CalendarManager.h"
#import <React/RCTLog.h>
#implementation CalendarManager
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(addEvent:(NSString *)name location:(NSString *)location)
{
RCTLogInfo(#"Pretending to create an event %# at %#", name, location);
}
Now, from your JavaScript file you can call the method like this:
import {NativeModules} from 'react-native';
var CalendarManager = NativeModules.CalendarManager;
CalendarManager.addEvent('Birthday Party', '4 Privet Drive, Surrey');
Please follow the below official link about the concept and how to do it.

Adwords Conversion Tracking with Tag Manager

We are trying to use the AdWords conversion tracking through Google Tag Manager, but we can't get the tracking status to change to verified. Probably the events aren't firing properly..
Has anyone got it to work?
Here is our process:
Create the Adwords campaign.
Create a iOS conversion tag in tag manager.
Integrate the Tag Manager.
This is the integration code:
// used for the container preview
NSURL *launchURL = launchOptions[UIApplicationLaunchOptionsURLKey];
[TAGManager.instance previewWithUrl:launchURL];
#if DEBUG
[[TAGManager instance].logger setLogLevel:kTAGLoggerLogLevelVerbose];
#endif
// https://developers.google.com/tag-manager/ios/v3/
[TAGContainerOpener openContainerWithId:#"GTM-TAAAAG"
tagManager:[TAGManager instance]
openType:kTAGOpenTypePreferNonDefault
timeout:nil
notifier:self];
#pragma mark - TAGContainerOpenerNotifier
- (void)containerAvailable:(TAGContainer *)container
{
TAGDataLayer *dataLayer = [TAGManager instance].dataLayer;
[dataLayer pushValue:#"appLaunch" forKey:#"event"];
}
Additional info:
Freaking Google...
The SDK was implemented by another developer, so I deleted and downloaded it again. After downloading the SDK, I RTFM that comes with it, as should any developer, and found this:
In order to ensure that the libAdIdAccess.a code doesn't get dead-stripped
from your executable during linking, you'll need to either add the -all_load
or -ObjC flag to the "Other Linker Flags", or, for finer-grained control, add the
-force_load flag (followed by a full pathname to libAdIdAccess.a).
I mean.. C'mon. Can't there be a useful error message that points out I was missing this? We can't use the -ObjC in our app due to a rogue library, so it was causing GTM to not work, and using the -force_load did the trick.
Now, I see the following log, which I didn't see before:
GoogleTagManager verbose: Successfully sent hit: http://www.googleadservices.com/pagead/conversion/...
And now, I am a happy panda.

iOS Test Failure - "No Implementation for…"

After completing my app I run a test from Xcode, Product -> Test, it says 'Build Succeeded' and the app pops up for a split second, but then it prompt me with this message:
I have searched a lot but couldn't find any solution that works in this case. I want to mention that I have also tried changing the name of the application from, CSQTCConference, to CSQTC Conference, not sure how relevant this is.
I am planning to release my application to app store today, but this issue is holding it back. It will be helpful if you can suggest any pointers to resolve this issue.
I just comment the following line:
//XCTFail(#"No implementation for \"%s\"", __PRETTY_FUNCTION__);
in:
#import <XCTest/XCTest.h>
#interface KinderAppTests : XCTestCase
#end
#implementation KinderAppTests
- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample
{
//XCTFail(#"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
#end
This solution worked for me, hope it helps :)
I'm not familiar with XCTest but I assume XCTFail will always fail, so no big surprise here.
You are running boilerplate example code, which created a test that always fails. If you haven't written your own tests what's the point of running them in the first place?
The real question is: Why is this happening?
Answer: You did a Command U, or selected test. This ran the default test, which always fails.
Correction: Comment out the fail line, and run it again.

how to respond to revmob sdk uialertview delegate?

Im trying to implement revmob sdk,
it works fine but their documentation dont have much detail and support not responding.
(http://sdk.revmob.com/sdks/ios/docs/index.html)
is there a way to use the delegate to know the status of the alertbox ?
this is what I currently use to call:
[BCFAds showPopupWithAppID:#"appId" withDelegate:nil];
after starting to ask the question I found the answer,
so incase someone else have this problem here is the solution.
to your .h file add a delegate called BCFAdsDelegate.
add #import "BCFAds.h"
in the .m file where you call the sdk add
[BCFAds showPopupWithAppID:#"appId" withDelegate:self];
use the method you want:
- (void)popupDidDismissActive;
// Called when user is back to the app
- (void)popupDidReceive;
// Called when a popup is available
- (void)popupDidFail;
// Called when a popup is not available
- (void)popupDidBecomeActive;
// Called when popup is displayed
- (void)popupDidDismissActive;
// Called when user is back to the app
- (void)userWillLeaveApplication;
// Called when user clicked and is about to leave the application

ComScore Analytics on iPhone

Had anybody done analytics with ComScore on iPhone? I am not able to understand how to start it. Can anyone help me in this please? - objective-c.
One can find answer here in this here pdf i used it for android.
The init method for ComScore is:
[CSComScore setAppContext];
But I believe you can also use:
[CSComScore start];
// Or...
[CSComScore startWithLabels:#{#"label1":#"value1"}];
And to track view changes/appearances:
[CSComScore view];
// Or..
[CSComScore viewWithLabels:#{#"testLabelA2":#"testValueA2", #"testLabelB2":#"testValueB2"}];
Be sure to look at the ComScore.h header file for the full list of methods used by their library.

Resources