KeepAwake native widget error

Hi guys, Based on the great video about creating native widgets ( )  I tried to create a simple widget for keeping your screen awake based on this component: but got error messages in het make it native app: TypeError: undefined is not an object (evaluating ‘r.default.activate’)     import { Component, createElement } from "react"; import React from 'react'; import { View, Text, Button } from 'react-native'; import KeepAwake from 'expo-keep-awake'; import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; export class KeepAwakeNative extends Component { render() { return ( <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <Button onPress={this._activate} title="Activate">Activate</Button> <Button onPress={this._deactivate} title="Deactivate">Deactivate</Button> </View> ); } _activate = () => { activateKeepAwake(); }; _deactivate = () => { deactivateKeepAwake(); }; } I dropped the code on so it would be great if someone can help me with this one, it will be available in the Appstore if fixed!   thanks!
1 answers

Hi Pim,

Did you link the library in your custom developer app? Looking at the github repo for this Library you need to follow an additional step for iOS installation, which won’t work with the Make It Native app. This step is called linking and makes sure that the Javascript code of the NPM library you use is linked to the necessary native code written in Swift or Java/Kotlin for respectively iOS and Android.

If thats the case, you can create a make it native app yourself with XCode (Mac)

Once you done that, you can follow the step called Installation in Bare React Native project (as Mendix Native is not based on expo).