
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@apr/react-native-userreport-sdk
Advanced tools
Running UserReport in React Native applications https://www.userreport.com
npm install --save @apr/react-native-userreport-sdk react-native-device-info
Update your AndroidMainfest.xml and declare that your app is an Ad Manager app, as instructed on Google's Ad Manager guide:
<manifest>
<application>
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>
</application>
</manifest>
react-native link react-native-device-info
react-native link @apr/react-native-userreport-sdk
cd ios
pod install
Follow the link: https://www.npmjs.com/package/react-native-device-info
Configure the UserReport ReactNative SDK using your PUBLISHER_ID and your MEDIA_ID.
Your PUBLISHER_ID and MEDIA_ID can be found on the Media Setting page in UserReport.
// Configure
UserReport.configure("PUBLISHER_ID","MEDIA_ID");
Note: only Android and iOS supported as a platform. So make sure you invoke configure only on these platforms. On other platforms, it will return an error.
Example:
//App.js
import {Platform} from 'react-native';
import UserReport from '@apr/react-native-userreport-sdk'
export default class App extends Component{
componentDidMount() {
var mediaId = Platform.OS === 'ios' ?
"MEDIA_ID_FOR_IOS": "MEDIA_ID_FOR_ANDROID";
UserReport.configure("PUBLISHER_ID",mediaId);
}
}
While development it is recommended to set debug flag in the settings parameter, so you will be able to understand that it is configured correctly, in case of errors they will be written to the console.
Example:
UserReport.configure("PUBLISHER_ID","MEDIA_ID", { debug: true });
There are two types of tracking:
UserReport.trackScreenView())UserReport.trackSectionScreenView())If a media (website) has one single topic, it can be tracked using UserReport.trackScreenView().
If a website has different sections, for instance Health, World news and Local news, then it should be tracked using UserReport.trackSectionScreenView(sectionId). The sectionId for a particular section can be found on the Media Setting page in UserReport.
Even when UserReport.trackSectionScreenView(sectionId) is used UserReport.trackScreenView() should be invoked as well.
Example of tracking screen view:
export default class ScreenView extends Component {
componentDidMount() {
UserReport.trackScreenView();
}
render() {...}
}
Example of tracking section screen view:
export default class ScreenView extends Component {
componentDidMount() {
UserReport.trackScreenView();
UserReport.trackSectionScreenView(sectionId);
}
render() {...}
}
You can configure SDK to use anonymous tracking using setAnonymousTracking command:
import UserReport from '@apr/react-native-userreport-sdk';
UserReport.setAnonymousTracking(true);
FAQs
Running UserReport in React Native applications https://www.userreport.com
We found that @apr/react-native-userreport-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.