Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - NewRelic extension trying to call missing function "recordEven:attributes" from SDK. #23

Open
marquisd opened this issue Mar 20, 2018 · 5 comments

Comments

@marquisd
Copy link

When following installation instructions, the app fails to compile for iOS.
The SDK is missing the class method NewRelicAgent record:attributes

Do the installation steps need to be updated? Does a specific node module version need to match a specific NewRelicAgent pod version?

Line where build fails:

RCT_EXPORT_METHOD(send: (NSString*)name :(NSDictionary*)args){
  [NewRelicAgent recordEvent:name attributes:args];    //<-- This function does not exist.  Build Fails.
}

Entire source file:

//
//  RNNewRelic.m
//  RNNewRelic
//
//  Created by Daniel Zlotin on 26/04/2016.
//  Copyright © 2016 Wix.com. All rights reserved.
//

#import "RNNewRelic.h"

@implementation RNNewRelic

RCT_EXPORT_MODULE();

RCT_EXPORT_METHOD(send: (NSString*)name :(NSDictionary*)args){
  [NewRelicAgent recordEvent:name attributes:args];    //<-- This function does not exist.  Build Fails.
}


RCT_EXPORT_METHOD(setAttribute: (NSString*)name: (NSString*)value){
  [NewRelicAgent setAttribute:name value:value];
}

// Logs a message to the native console
RCT_EXPORT_METHOD(nativeLog:(NSString *)msg){
  NSLog(@"%@", msg);
}

@end
@SparkleFaerieCoder
Copy link

It looks like the library hasn't updated that file to reflect the changes in the New Relic SDK version 5.12.0 which deprecated RecordEvent and replaced it with RecordCustomEvent.

@williamcardozo
Copy link

any consideration on this?

@shtefanilie
Copy link

As @SparkleFaerieCoder mentioned above, I've changed recordEvent as below.
// replace this [NewRelicAgent recordEvent:name attributes:args]; // with this [NewRelicAgent recordCustomEvent:name attributes:args]

Hope this works :)

sandor11 added a commit to sandor11/react-native-newrelic that referenced this issue Mar 29, 2019
Addressing Issue wix-incubator#23 facebook/react-native#21498

If you follow the guidance given wix-incubator#23 (comment) then you can get this working. But if you need to build your app in a CI/CD environment, then no way to edit your node modules.

This change brings this bridge in line with the current NewRelic agent.
@granchicop
Copy link

hello guys, i have another problem on iOS, when my app is starting i had this error:
https://ibb.co/KbwBtVH

undefined is not and object (evaluating 'RNNewRelic.setAttribute')

any of you solved this before that can help me?
thanks for the help

@nisargdesai15
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants