Created
May 7, 2018 11:50
-
-
Save GaborWnuk/be1c4a6cfea9aa0f1307b36ba18dff58 to your computer and use it in GitHub Desktop.
FancyManager.kt for React Native project based on Kotlin with Promise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.wp.wdi | |
import android.content.Intent | |
import com.facebook.react.bridge.ReactApplicationContext | |
import com.facebook.react.bridge.ReactContextBaseJavaModule | |
import com.facebook.react.bridge.ReactMethod | |
import com.facebook.react.bridge.Promise; | |
import android.util.Log | |
class FancyManager(reactContext: ReactApplicationContext): ReactContextBaseJavaModule(reactContext) { | |
override fun getName(): String { | |
return "FancyNativeModule" | |
} | |
@ReactMethod | |
fun addNumbers(first: Int, second: Int, promise: Promise) { | |
promise.resolve(first + second); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment