[iOS] Changed parameter name in subscription deeplink

This commit is contained in:
Alexander Boriskov 2019-11-27 16:58:05 +03:00 committed by Arsentiy Milchakov
parent 31178e4277
commit 8fbf416790
5 changed files with 10 additions and 16 deletions

View file

@ -6,7 +6,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface DeepLinkSubscriptionData : NSObject <IDeepLinkData>
@property (nonatomic, readonly) DeeplinkParsingResult result;
@property(nonatomic, readonly) NSString* deliverable;
@property(nonatomic, readonly) NSString* groups;
- (instancetype)init:(DeeplinkParsingResult)result;

View file

@ -8,7 +8,7 @@
if (self) {
_result = result;
auto const &request = GetFramework().GetParsedSubscription();
_deliverable = @(request.m_deliverable.c_str());
_groups = @(request.m_groups.c_str());
}
return self;
}

View file

@ -11,15 +11,9 @@ class DeepLinkSubscriptionStrategy: IDeepLinkHandlerStrategy {
guard let mapViewController = MapViewController.shared() else {
return;
}
let type: SubscriptionGroupType
switch data.deliverable {
case MWMPurchaseManager.bookmarksSubscriptionServerId():
type = .sightseeing
case MWMPurchaseManager.allPassSubscriptionServerId():
type = .allPass
default:
LOG(.error, "Deliverable is wrong: \(deeplinkURL.url)");
return;
guard let type: SubscriptionGroupType = SubscriptionGroupType(serverId: data.groups) else {
LOG(.error, "Groups is wrong: \(deeplinkURL.url)");
return
}
mapViewController.dismiss(animated: false, completion: nil)
mapViewController.navigationController?.popToRootViewController(animated: false)

View file

@ -108,7 +108,7 @@ namespace catalogue_path
namespace subscription
{
char const * kDeliverable = "deliverable";
char const * kGroups = "groups";
} // namespace subscription
namespace
@ -310,7 +310,7 @@ ParsedMapApi::ParsingResult ParsedMapApi::Parse(Uri const & uri)
return SubscriptionKeyValue(key, value, item);
});
if (!result || item.m_deliverable.empty())
if (!result || item.m_groups.empty())
return ParsingResult::Incorrect;
m_subscription = item;
@ -518,8 +518,8 @@ bool ParsedMapApi::CatalogPathKeyValue(string const & key, string const & value,
bool ParsedMapApi::SubscriptionKeyValue(string const & key, string const & value, Subscription & item) const
{
if (key == subscription::kDeliverable)
item.m_deliverable = value;
if (key == subscription::kGroups)
item.m_groups = value;
return true;
}

View file

@ -50,7 +50,7 @@ struct CatalogPath
struct Subscription
{
std::string m_deliverable;
std::string m_groups;
};
namespace lead