{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/8891","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/8891/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/8891/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/8891/events","html_url":"https://github.com/facebook/react-native/issues/8891","id":166299066,"number":8891,"title":"How to sendEvent from iOS to javascript","user":{"login":"Arthraim","id":133202,"avatar_url":"https://avatars.githubusercontent.com/u/133202?v=3","gravatar_id":"","url":"https://api.github.com/users/Arthraim","html_url":"https://github.com/Arthraim","followers_url":"https://api.github.com/users/Arthraim/followers","following_url":"https://api.github.com/users/Arthraim/following{/other_user}","gists_url":"https://api.github.com/users/Arthraim/gists{/gist_id}","starred_url":"https://api.github.com/users/Arthraim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arthraim/subscriptions","organizations_url":"https://api.github.com/users/Arthraim/orgs","repos_url":"https://api.github.com/users/Arthraim/repos","events_url":"https://api.github.com/users/Arthraim/events{/privacy}","received_events_url":"https://api.github.com/users/Arthraim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-19T10:33:10Z","updated_at":"2016-07-19T10:33:10Z","closed_at":null,"body":"I'm doing something Async in iOS app, it's triggered by javascript. When it's done (somewhere separated in app), I want to let javascript know.\r\nMy current solution is a native module inherited from `RCTEventEmitter`, has a method like \r\n\r\n```\r\n@interface MyEventEmitter : RCTEventEmitter\r\n// ...\r\nend\r\n@implementation\r\n- (void)giveSomethingToJS:(NSString *)something {\r\n  [self sendEventWithName:@\"SOME_NAME\" body:something];\r\n}\r\n@end\r\n```\r\n\r\nThen when my Async job's done, I call this method like\r\n\r\n```\r\nMyEventEmitter *emitter = [[MyEventEmitter alloc] init];\r\n[emitter giveSomethingToJS:@{}];\r\n```\r\n\r\nAnd obviously, `emitter.bridge` is nil and app crashed because of assert `bridge != nil`. So how am I get the bridge and let `*emitter`(the instance) know. Or how can I get the right instance with bridge initialized?\r\n\r\nThanks in advance!"}}
{"actor":{"display_login":"Arthraim"}}