Rapsssito / react-native-background-actions

React Native background service library for running background tasks forever in Android & iOS.
MIT License
818 stars 117 forks source link

It is not executing all the line which is mention in BackgroundService.start. #139

Closed Pranavpatel428 closed 1 year ago

Pranavpatel428 commented 2 years ago

Hi Guys, I am a trying to execute code in a screen after I run navigation.goBack(), it was working completely fine for a couple of releases but now it suddenly stopped executing the code after the navigation.goBack(). It is supposed to work something like this:

let personalPostTask = async () => { navigation.goBack();

await createPost({
  variables: {
    postContent: {
      media: mediaFileArray,
      body: postText,
      privacy: postStatus,
    },
    tags: {
      userTags: TempList,
    },
  },
});
//From this line it is not executing.
dispatchUserState({
  type: UserAction.Update,
});
Toast.showWithGravity(
  "Personal Post Uploaded Successfully !",
  Toast.SHORT,
  Toast.BOTTOM
);

};

Rapsssito commented 1 year ago

@Pranavpatel428, I am sorry, but you cannot access the UI from the background tasks.