remobile / react-native-toast

A android like toast for android and ios, android use native toast, ios use UIView+Toast
MIT License
346 stars 146 forks source link

Sample project #13

Closed lunanigra closed 7 years ago

lunanigra commented 7 years ago

Hi, I'm new to Xcode and try to install your toast module.

First it would be helpful to describe the steps more details. Especially I do not fully get the last point... Look for Header Search Paths and make sure it contains both $(SRCROOT)/../../../react-native/React as recursive.

What should be exactly defined as HEADER_SEARCH_PATHS?

Within React JS file I tried...

import Toast from '@remobile/react-native-toast'; Toast.showLongCenter.bind(null, "this is a message");

But no error and no Toast. Any idea? Adding a small sample project might be quite helpful.

lunanigra commented 7 years ago

I checked again in Xcode and also tried the Android setup - at the end same error.

The module is not found and the require method returns an error... Requiring unknown module 'react-native-toast'

var Toast = require('react-native-toast');

fov42550564 commented 7 years ago

see https://github.com/remobile/react-native-template

stwiname commented 7 years ago

@lunanigra The header search path is probably already set.

Try cleaning the project in xcode (Product -> Clean). Then rebuild.

lunanigra commented 7 years ago

@fov42550564 Thanks, unluckily it's all Chinese or some other language I do not understand.

@stwiname Already checked this and also tried Android to avoid iOS specific issues. But whenever I try to include 'react-native-toast' there is an error saying this module does not exist. 'react-native-toast' is not listed in the node_modules folder; but I assume this is normal.

Is there any other full sample available? Would be cool :-)

fov42550564 commented 7 years ago

use var Toast = require('@remobile/react-native-toast');

lunanigra commented 7 years ago

Thanks, this 'works' without error. Unluckily it just means no error; I don't see any Toast.

Toast.showLongCenter.bind(null, "this is a message");

But thanks for confirming the right require call.

fov42550564 commented 7 years ago

you can debug it use xcode or android studio

lunanigra commented 7 years ago

Got it running... Problem was the toast call itself. If used in a custom method just call directly without bind() and it works...

Toast.showLongCenter("this is a message")