forked from organicmaps/organicmaps
[iOS] validate subscription on startup only when allowed to use network
This commit is contained in:
parent
17db573531
commit
9d30a10099
3 changed files with 13 additions and 1 deletions
iphone/Maps
|
@ -390,7 +390,9 @@ using namespace osm_auth_ios;
|
|||
if (@available(iOS 10, *))
|
||||
[UNUserNotificationCenter currentNotificationCenter].delegate = self;
|
||||
|
||||
[[SubscriptionManager shared] validate];
|
||||
if ([MWMFrameworkHelper canUseNetwork])
|
||||
[[SubscriptionManager shared] validate];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,4 +10,6 @@
|
|||
|
||||
+ (void)createFramework;
|
||||
|
||||
+ (BOOL)canUseNetwork;
|
||||
|
||||
@end
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "Framework.h"
|
||||
|
||||
#include "base/sunrise_sunset.hpp"
|
||||
#include "platform/network_policy.hpp"
|
||||
|
||||
@implementation MWMFrameworkHelper
|
||||
|
||||
|
@ -66,4 +67,11 @@
|
|||
}
|
||||
|
||||
+ (void)createFramework { UNUSED_VALUE(GetFramework()); }
|
||||
|
||||
+ (BOOL)canUseNetwork
|
||||
{
|
||||
return platform::GetCurrentNetworkPolicy().CanUse() ||
|
||||
GetPlatform().ConnectionStatus() != Platform::EConnectionType::CONNECTION_WWAN;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Reference in a new issue