ComScore Analytics on iPhone - ios

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.

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.

Swift 2 - Visualizing an AVMutableComposition for Debugging : Converting Apple's AVCompositionDebugViewer

I'm running into an issue with my swift 2 conversion of an Apple provided example for displaying an AVMutableComposition. This is a really useful project if you're trying to visualize your AVComposition to see what might be going on under the hood.
Update: I added print statements to each function to see the order they are being called, and who is calling them, in comparison to the Obj-C project.
Two Issues that I'm seeing that seem pretty important:
synchronizePlayerWithEditor() is not getting called after buildTransitionComposition(_:andVideoComposition:andAudioMix:)
observeValueForKeyPath(_:...) is NOT being called in the same order as the Obj-C project
Posting the snippet here to get the calling function as it's kind of useful
Obj-C
NSLog(#"%d %s %#", __LINE__, __PRETTY_FUNCTION__, [[NSThread callStackSymbols] objectAtIndex:1]);
Swift
func functionnYouWantToPrintCaller(yourNormalParameters..., function:String = __FUNCTION__){...}
print("\(__LINE__) \(__FUNCTION__) \(function)
Here is Apple's AVCompositionDebugViewer project I'm working from: https://developer.apple.com/library/mac/samplecode/AVCompositionDebugViewer
My github repo:
https://github.com/justinlevi/iOSAVCompositionDebugViewerSwift
I think the issue might be stemming from something in the keyValueObservation code although I'm not entirely sure at this point.
The issue ended up being in SimpleEditor.swiftbuildCompositionObjectsForPlayback` method. There were some global variables that were being defined incorrectly.
Everything seems to be working as expected now.
https://github.com/justinlevi/iOSAVCompositionDebugViewerSwift

swift - CCBReader symbol not found

Currently I am trying to accomplish with Cocos2d-swift+SpriteBuilder and their tutorial provided there
I am trying to do this not in Objective-C but in Swift. So during the tutorial I have faced with the issue when Xcode can't find CCBReader.
As I can see from the project structure, it is in place. The place where I stuck is:
var ball: CCNode = CCBReader.load("Bird")
In the tutorial this line looks like:
CCNode *ball = [CCBReader load:#"Bird"];
The main problem is that I can't get access to the CCBReader while it presents in the libs.
Could someone help me with this please?
This issue was fixed by Cocos2d-Swift 3.4beta + SpriteBuilder 1.4.
http://forum.spritebuilder.com/t/spritebuilder-1-4-beta-release/2573

How to set up the iOS Telegram Source Code

Hi I have downloaded the iOS source code for iOS but for some reason I cannot seem to find the place where the API_ID is anywhere. Please can you tell me where this information is in the source code so I can add in my own.
Add a file called "config.h" beside Telegraph.xcodeproj and place this code in that:
#define SETUP_API_ID(apiId) apiId = YOUR_API_ID;
#define SETUP_API_HASH(apiHash) apiHash = YOUR_API_HASH;
Then replace YOUR_API_ID and YOUR_API_HASH with values obtained from telegram api support.
Then compile and enjoy it!
Try to use the project search and put API, it`ll return the files where is.

How to intercept adding calls to call history in iOS?

I'm developing a tweak for jailbroken iPhones. I'm trying to intercept the process of a call being added to the call history. With a little bit search I found CTCallHistoryStoreAddCall function in CoreTelephony framework found here. When I try to use it I get an error:
Undefined symbols for architecture armv7: "_CTCallHistoryStoreAddCall"
I linked the CoreTelephony framework and the way I used it in my code was:
typedef struct __CTCall * CTCallRef;
extern "C" void CTCallHistoryStoreAddCall(CTCallRef call);
I guess that means this function does not exist anymore or if it does I'm not using it in the correct way.
How can I find the right function that is responsible for adding an incoming phone call to the call history?
Thanks in advanced.
I'm using iOSOpenDev on Xcode 5.
There is no such function. At least in iOS7.
I've posted solution for iOS7 here Hide a phone call completely in iOS (jailbreak device)
Here is the code:
//Private API from CoreTelephony.framework
void CTCallDeleteFromCallHistory(CTCallRef call);
%hook PHRecentCall
-(id)initWithCTCall:(CTCallRef)call
{
if (IsCallShouldBeDeleted(call) == YES)
{
//Delete call from call history
CTCallDeleteFromCallHistory(call);
//Update MobilePhone app UI
id PHRecentsViewController = [[[[[UIApplication sharedApplication] delegate] rootViewController] tabBarViewController] recentsViewController];
if ([PHRecentsViewController isViewLoaded])
{
[PHRecentsViewController resetCachedIndexes];
[PHRecentsViewController _reloadTableViewAndNavigationBar];
}
//Try uncommenting this, may be it will work. Should make the code faster.
//return nil;
}
return %orig;
}
%end
Tweak hooks class inside MobilePhone app so bundle filter is com.apple.mobilephone.
IsCallShouldBeDeleted is pseudo function that determines whether a call should be deleted. You can remove it or implement your own. It's there just to make the code more clear.
On iOS6 class names are different but code is exactly the same - Apple just renamed the classes. I use that solution since iOS4. Also on iOS4 it requires a bit more code as there was no CTCallDeleteFromCallHistory function.
You are encountering this error because the CoreTelephony framework is not being linked to your program. To fix this, add the following to your makefile:
PROJECT_NAME_PRIVATE_FRAMEWORKS = CoreTelephony
Note that you have to replace PROJECT_NAME with your own project's name.

Resources