Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

What to do after fuse.init failed? Seems to only allow init once
Started by Nob Studio Jul 14 2015 12:02 PM

4 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Nob Studio

[GLOBAL: userInfoPane.html]
Nob Studio
  • Contributor

  • 153 posts
  • Corona SDK

Hi,

 

If fuse.init is unsuccessful and returns an error, how do I call it to init again?
For example if I open the game without internet, fuse.init will fail (NOT_CONNECTED). Even if I turn on internet on after, the ads won't load because it is not init correctly. I tried to call fuse.init again but there is no response. (from the document it say can only init once?)
 
I tested many times and the only way to show ads again is for user to manually force close the app and re-open with internet connection. Even if I close the app with native.requestExit() it won't work because the app seems not closed completely. 
 
I am testing on android device. I have yet to try on iOS but I think with os.exit it should work fine.
 
If fuse.init failed, I wish to either
1. game pops up a warning and close itself entirely, and player can re-open the app with wifi again or
2. able to call init again when player turns on wifi?
 
Appreciate any help!


[TOPIC: post.html]
#2

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @Nob Studio,

Instead of checking post-init, can you check if the device can receive network communication at all? Then, if so, call the Fuse init?

 

Brent



[TOPIC: post.html]
#3

Nob Studio

[GLOBAL: userInfoPane.html]
Nob Studio
  • Contributor

  • 153 posts
  • Corona SDK

Thanks Brent for the reply. 

 

I tried your method which check for network.getConnectionStatus()

 

Unfortunately the init seems to have error if I turn off internet connection at start, and turn on after I opened the app then call fuse.init.

When I call fuse.show there is an event error with response: an error occurred during fuse initialization so call is ignored



[TOPIC: post.html]
#4

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @Nob Studio,

So basically, this only occurs when you turn off the Internet? Are you 100% sure that the Internet is enabled and running before you call fuse.init()?

 

Brent



[TOPIC: post.html]
#5

Nob Studio

[GLOBAL: userInfoPane.html]
Nob Studio
  • Contributor

  • 153 posts
  • Corona SDK

Hi, yes I am sure. I did a lot of various testing and here are the findings:

 

1. Start the app with internet OFF, then turn on internet and call fuse.init, fuse init has problem, even fuse.getProperty() doesn't work.

2. Start the app with internet OFF, then exit app with native.requestExit(), turn on internet > start the app > call fuse.init, fuse init has problem
3. Start the app with internet ON, then turn off internet and on again, fuse init works
4. Start the app with internet ON, then turn off internet and on again, fuse init works
 
When calling fuse.init with internet off, it will return error Not_connected, but start the app with internet Off and on again, it will not return error.
 
Can you test if this is the case? Thanks.



[topic_controls]
[/topic_controls]