- Upgrade Libraries

This commit is contained in:
giuseppenuc committed 2019-10-23 01:07:16 +02:00
1 parent 060efc0c83
commit f84e3ef366
535 files changed
+14099 -19527

No files matched your search

@@ -18,265 +18,7 @@
#import <Foundation/Foundation.h>
/**
These are the fields currently exposed by FBSDKPlacesKit. They map to the fields on
Place objects returned by the Graph API, which can be found here:
https://developers.facebook.com/docs/places. Should fields be added to the Graph API in
the future, you can use strings found in the online documenation in addition to
these string constants.
*/
/**
Field Key for information about the Place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyAbout;
/**
Field Key for AppLinks for the Place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyAppLinks;
/**
Field Key for the Place's categories.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyCategories;
/**
Field Key for the number of checkins at the Place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyCheckins;
/**
Field Key for the confidence level for a current place estimate candidate.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyConfidence;
/**
Field Key for the Place's cover photo. Note that this is not the actual photo data,
but rather URLs and other metadata.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyCoverPhoto;
/**
Field Key for the description of the Place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyDescription;
/**
Field Key for the social sentence and like count information for this place. This is
the same information used for the Like button.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyEngagement;
/**
Field Key for hour ranges for when the Place is open. Each day can have two different
hours ranges. The keys in the dictionary are in the form of {day}_{number}_{status}.
{day} should be the first 3 characters of the day of the week, {number} should be
either 1 or 2 to allow for the two different hours ranges per day. {status} should be
either open or close, to delineate the start or end of a time range. An example would
be mon_1_open with value 17:00 and mon_1_close with value 21:15 which would represent
a single opening range of 5 PM to 9:15 PM on Mondays. You can find an example of hours
being parsed out in the Sample App.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyHours;
/**
Field Key for a value indicating whether this place is always open.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyIsAlwaysOpen;
/**
Field Key for a value indicating whether this place is permanently closed.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyIsPermanentlyClosed;
/**
Pages with a large number of followers can be manually verified by Facebook as having an
authentic identity. This field indicates whether the page is verified by this process.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyIsVerified;
/**
Field Key for address and latitude/longitude information for the place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyLocation;
/**
Field Key for a link to Place's Facebook page.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyLink;
/**
Field Key for the name of the place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyName;
/**
Field Key for the overall page rating based on rating surveys from users on a scale
from 1-5. This value is normalized, and is not guaranteed to be a strict average of
user ratings.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyOverallStarRating;
/**
Field Key for the Facebook Page information.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyPage;
/**
Field Key for PageParking information for the Place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyParking;
/**
Field Key for available payment options.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyPaymentOptions;
/**
Field Key for the unique Facebook ID of the place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyPlaceID;
/**
Field Key for the Place's phone number.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyPhone;
/**
Field Key for the Place's photos. Note that this is not the actual photo data, but
rather URLs and other metadata.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyPhotos;
/**
Field Key for the price range of the business, expressed as a string. Applicable to
Restaurants or Nightlife. Can be one of $ (0-10), $$ (10-30), $$$ (30-50), $$$$ (50+),
or Unspecified.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyPriceRange;
/**
Field Key for the Place's profile photo. Note that this is not the actual photo data,
but rather URLs and other metadata.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyProfilePhoto;
/**
Field Key for the number of ratings for the place.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyRatingCount;
/**
Field Key for restaurant services e.g: delivery, takeout.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyRestaurantServices;
/**
Field Key for restaurant specialties.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyRestaurantSpecialties;
/**
Field Key for the address in a single line.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeySingleLineAddress;
/**
Field Key for the string of the Place's website URL.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyWebsite;
/**
Field Key for the Workflows.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesFieldKeyWorkflows;
/**
Response Key for the place's city field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyCity;
/**
Response Key for the place's city ID field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyCityID;
/**
Response Key for the place's country field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyCountry;
/**
Response Key for the place's country code field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyCountryCode;
/**
Response Key for the place's latitude field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyLatitude;
/**
Response Key for the place's longitude field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyLongitude;
/**
Response Key for the place's region field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyRegion;
/**
Response Key for the place's region ID field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyRegionID;
/**
Response Key for the place's state field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyState;
/**
Response Key for the place's street field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyStreet;
/**
Response Key for the place's zip code field.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyZip;
/**
Response Key for the categories that this place matched.
To be used on the search request if the categories parameter is specified.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyMatchedCategories;
/**
Response Key for the photo source dictionary.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyPhotoSource;
/**
Response Key for response data.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyData;
/**
Response Key for a URL.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesResponseKeyUrl;
/**
Parameter Key for the current place summary.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesParameterKeySummary;
/**
Summary Key for the current place tracking ID.
*/
FOUNDATION_EXPORT NSString *const FBSDKPlacesSummaryKeyTracking;
NS_ASSUME_NONNULL_BEGIN
/**
The level of confidence the Facebook SDK has that a Place is the correct one for the
@@ -288,9 +30,286 @@ FOUNDATION_EXPORT NSString *const FBSDKPlacesSummaryKeyTracking;
- FBSDKPlaceLocationConfidenceMedium: Medium confidence level.
- FBSDKPlaceLocationConfidenceHigh: High confidence level.
*/
typedef NS_ENUM(NSInteger) {
typedef NS_ENUM(NSInteger, FBSDKPlaceLocationConfidence) {
FBSDKPlaceLocationConfidenceNotApplicable,
FBSDKPlaceLocationConfidenceLow,
FBSDKPlaceLocationConfidenceMedium,
FBSDKPlaceLocationConfidenceHigh
} FBSDKPlaceLocationConfidence;
} NS_SWIFT_NAME(PlaceLocationConfidence);
/**
These are the fields currently exposed by FBSDKPlacesKit. They map to the fields on
Place objects returned by the Graph API, which can be found
[here](https://developers.facebook.com/docs/places ). Should fields be added to the Graph API in
the future, you can use strings found in the online documenation in addition to
these string constants.
*/
/// typedef for FBSDKPlacesCategoryKey
typedef NSString *const FBSDKPlacesCategoryKey NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(PlacesCategoryKey);
/// typedef for FBSDKPlacesFieldKey
typedef NSString *const FBSDKPlacesFieldKey NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(PlacesFieldKey);
/// typedef for FBSDKPlacesResponseKey
typedef NSString *const FBSDKPlacesResponseKey NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(PlacesResponseKey);
/// typedef for FBSDKPlacesParameterKey
typedef NSString *const FBSDKPlacesParameterKey NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(PlacesParameterKey);
/// typedef for FBSDKPlacesSummaryKey
typedef NSString *const FBSDKPlacesSummaryKey NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(PlacesSummaryKey);
/**
Field Key for information about the Place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyAbout;
/**
Field Key for AppLinks for the Place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyAppLinks;
/**
Field Key for the Place's categories.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyCategories;
/**
Field Key for the number of checkins at the Place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyCheckins;
/**
Field Key for the confidence level for a current place estimate candidate.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyConfidence;
/**
Field Key for the Place's cover photo. Note that this is not the actual photo data,
but rather URLs and other metadata.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyCoverPhoto;
/**
Field Key for the description of the Place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyDescription;
/**
Field Key for the social sentence and like count information for this place. This is
the same information used for the Like button.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyEngagement;
/**
Field Key for hour ranges for when the Place is open. Each day can have two different
hours ranges. The keys in the dictionary are in the form of {day}_{number}_{status}.
{day} should be the first 3 characters of the day of the week, {number} should be
either 1 or 2 to allow for the two different hours ranges per day. {status} should be
either open or close, to delineate the start or end of a time range. An example would
be mon_1_open with value 17:00 and mon_1_close with value 21:15 which would represent
a single opening range of 5 PM to 9:15 PM on Mondays. You can find an example of hours
being parsed out in the Sample App.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyHours;
/**
Field Key for a value indicating whether this place is always open.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyIsAlwaysOpen;
/**
Field Key for a value indicating whether this place is permanently closed.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyIsPermanentlyClosed;
/**
Pages with a large number of followers can be manually verified by Facebook as having an
authentic identity. This field indicates whether the page is verified by this process.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyIsVerified;
/**
Field Key for address and latitude/longitude information for the place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyLocation;
/**
Field Key for a link to Place's Facebook page.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyLink;
/**
Field Key for the name of the place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyName;
/**
Field Key for the overall page rating based on rating surveys from users on a scale
from 1-5. This value is normalized, and is not guaranteed to be a strict average of
user ratings.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyOverallStarRating;
/**
Field Key for the Facebook Page information.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPage;
/**
Field Key for PageParking information for the Place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyParking;
/**
Field Key for available payment options.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPaymentOptions;
/**
Field Key for the unique Facebook ID of the place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPlaceID;
/**
Field Key for the Place's phone number.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPhone;
/**
Field Key for the Place's photos. Note that this is not the actual photo data, but
rather URLs and other metadata.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPhotos;
/**
Field Key for the price range of the business, expressed as a string. Applicable to
Restaurants or Nightlife. Can be one of $ (0-10), $$ (10-30), $$$ (30-50), $$$$ (50+),
or Unspecified.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPriceRange;
/**
Field Key for the Place's profile photo. Note that this is not the actual photo data,
but rather URLs and other metadata.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyProfilePhoto;
/**
Field Key for the number of ratings for the place.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyRatingCount;
/**
Field Key for restaurant services e.g: delivery, takeout.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyRestaurantServices;
/**
Field Key for restaurant specialties.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyRestaurantSpecialties;
/**
Field Key for the address in a single line.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeySingleLineAddress;
/**
Field Key for the string of the Place's website URL.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyWebsite;
/**
Field Key for the Workflows.
*/
FOUNDATION_EXPORT FBSDKPlacesFieldKey FBSDKPlacesFieldKeyWorkflows;
/**
Response Key for the place's city field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyCity;
/**
Response Key for the place's city ID field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyCityID;
/**
Response Key for the place's country field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyCountry;
/**
Response Key for the place's country code field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyCountryCode;
/**
Response Key for the place's latitude field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyLatitude;
/**
Response Key for the place's longitude field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyLongitude;
/**
Response Key for the place's region field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyRegion;
/**
Response Key for the place's region ID field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyRegionID;
/**
Response Key for the place's state field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyState;
/**
Response Key for the place's street field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyStreet;
/**
Response Key for the place's zip code field.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyZip;
/**
Response Key for the categories that this place matched.
To be used on the search request if the categories parameter is specified.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyMatchedCategories;
/**
Response Key for the photo source dictionary.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyPhotoSource;
/**
Response Key for response data.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyData;
/**
Response Key for a URL.
*/
FOUNDATION_EXPORT FBSDKPlacesResponseKey FBSDKPlacesResponseKeyUrl;
/**
Parameter Key for the current place summary.
*/
FOUNDATION_EXPORT FBSDKPlacesParameterKey FBSDKPlacesParameterKeySummary;
/**
Summary Key for the current place tracking ID.
*/
FOUNDATION_EXPORT FBSDKPlacesSummaryKey FBSDKPlacesSummaryKeyTracking;
NS_ASSUME_NONNULL_END
@@ -18,56 +18,56 @@
#include "FBSDKPlacesKitConstants.h"
NSString *const FBSDKPlacesFieldKeyAbout = @"about";
NSString *const FBSDKPlacesFieldKeyAppLinks = @"app_links";
NSString *const FBSDKPlacesFieldKeyCategories = @"category_list";
NSString *const FBSDKPlacesFieldKeyCheckins = @"checkins";
NSString *const FBSDKPlacesFieldKeyConfidence = @"confidence_level";
NSString *const FBSDKPlacesFieldKeyCoverPhoto = @"cover";
NSString *const FBSDKPlacesFieldKeyDescription = @"description";
NSString *const FBSDKPlacesFieldKeyEngagement = @"engagement";
NSString *const FBSDKPlacesFieldKeyHours = @"hours";
NSString *const FBSDKPlacesFieldKeyIsAlwaysOpen = @"is_always_open";
NSString *const FBSDKPlacesFieldKeyIsPermanentlyClosed = @"is_permanently_closed";
NSString *const FBSDKPlacesFieldKeyIsVerified = @"is_verified";
NSString *const FBSDKPlacesFieldKeyLink = @"link";
NSString *const FBSDKPlacesFieldKeyLocation = @"location";
NSString *const FBSDKPlacesFieldKeyName = @"name";
NSString *const FBSDKPlacesFieldKeyOverallStarRating = @"overall_star_rating";
NSString *const FBSDKPlacesFieldKeyPlaceID = @"id";
NSString *const FBSDKPlacesFieldKeyPage = @"page";
NSString *const FBSDKPlacesFieldKeyParking = @"parking";
NSString *const FBSDKPlacesFieldKeyPaymentOptions = @"payment_options";
NSString *const FBSDKPlacesFieldKeyPhone = @"phone";
NSString *const FBSDKPlacesFieldKeyProfilePhoto = @"picture";
NSString *const FBSDKPlacesFieldKeyPhotos = @"photos";
NSString *const FBSDKPlacesFieldKeyPriceRange = @"price_range";
NSString *const FBSDKPlacesFieldKeyRatingCount = @"rating_count";
NSString *const FBSDKPlacesFieldKeyRestaurantServices = @"restaurant_services";
NSString *const FBSDKPlacesFieldKeyRestaurantSpecialties = @"restaurant_specialties";
NSString *const FBSDKPlacesFieldKeySingleLineAddress = @"single_line_address";
NSString *const FBSDKPlacesFieldKeyWebsite = @"website";
NSString *const FBSDKPlacesFieldKeyWorkflows = @"workflows";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyAbout = @"about";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyAppLinks = @"app_links";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyCategories = @"category_list";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyCheckins = @"checkins";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyConfidence = @"confidence_level";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyCoverPhoto = @"cover";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyDescription = @"description";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyEngagement = @"engagement";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyHours = @"hours";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyIsAlwaysOpen = @"is_always_open";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyIsPermanentlyClosed = @"is_permanently_closed";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyIsVerified = @"is_verified";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyLink = @"link";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyLocation = @"location";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyName = @"name";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyOverallStarRating = @"overall_star_rating";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPlaceID = @"id";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPage = @"page";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyParking = @"parking";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPaymentOptions = @"payment_options";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPhone = @"phone";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyProfilePhoto = @"picture";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPhotos = @"photos";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyPriceRange = @"price_range";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyRatingCount = @"rating_count";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyRestaurantServices = @"restaurant_services";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyRestaurantSpecialties = @"restaurant_specialties";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeySingleLineAddress = @"single_line_address";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyWebsite = @"website";
FBSDKPlacesFieldKey FBSDKPlacesFieldKeyWorkflows = @"workflows";
NSString *const FBSDKPlacesResponseKeyCity = @"city";
NSString *const FBSDKPlacesResponseKeyCityID = @"city_id";
NSString *const FBSDKPlacesResponseKeyCountry = @"country";
NSString *const FBSDKPlacesResponseKeyCountryCode = @"country_code";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyCity = @"city";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyCityID = @"city_id";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyCountry = @"country";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyCountryCode = @"country_code";
NSString *const FBSDKPlacesResponseKeyLatitude = @"latitude";
NSString *const FBSDKPlacesResponseKeyLongitude = @"longitude";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyLatitude = @"latitude";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyLongitude = @"longitude";
NSString *const FBSDKPlacesResponseKeyRegion = @"region";
NSString *const FBSDKPlacesResponseKeyRegionID = @"region_id";
NSString *const FBSDKPlacesResponseKeyState = @"state";
NSString *const FBSDKPlacesResponseKeyStreet = @"street";
NSString *const FBSDKPlacesResponseKeyZip = @"zip";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyRegion = @"region";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyRegionID = @"region_id";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyState = @"state";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyStreet = @"street";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyZip = @"zip";
NSString *const FBSDKPlacesResponseKeyMatchedCategories = @"matched_categories";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyMatchedCategories = @"matched_categories";
NSString *const FBSDKPlacesResponseKeyPhotoSource = @"source";
NSString *const FBSDKPlacesResponseKeyData = @"data";
NSString *const FBSDKPlacesResponseKeyUrl = @"url";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyPhotoSource = @"source";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyData = @"data";
FBSDKPlacesResponseKey FBSDKPlacesResponseKeyUrl = @"url";
NSString *const FBSDKPlacesParameterKeySummary = @"summary";
NSString *const FBSDKPlacesSummaryKeyTracking = @"tracking";
FBSDKPlacesParameterKey FBSDKPlacesParameterKeySummary = @"summary";
FBSDKPlacesSummaryKey FBSDKPlacesSummaryKeyTracking = @"tracking";
@@ -23,6 +23,8 @@
#import "FBSDKPlacesKitConstants.h"
NS_ASSUME_NONNULL_BEGIN
/**
Completion block for aysnchronous place request generation.
@@ -34,7 +36,10 @@
@param error An error indicating a failure in a location services request.
*/
typedef void (^FBSDKPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Nullable graphRequest, CLLocation *_Nullable location, NSError *_Nullable error);
typedef void (^FBSDKPlaceGraphRequestBlock)(FBSDKGraphRequest *_Nullable graphRequest,
CLLocation *_Nullable location,
NSError *_Nullable error)
NS_SWIFT_NAME(PlaceGraphRequestBlock);
/**
Completion block for aysnchronous current place request generation.
@@ -44,7 +49,9 @@ typedef void (^FBSDKPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Nullable gr
@param error An error indicating a failure in a location services request.
*/
typedef void (^FBSDKCurrentPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Nullable graphRequest, NSError *_Nullable error);
typedef void (^FBSDKCurrentPlaceGraphRequestBlock)(FBSDKGraphRequest *_Nullable graphRequest,
NSError *_Nullable error)
NS_SWIFT_NAME(CurrentPlaceGraphRequestBlock);
/**
`FBSDKPlacesManager` provides methods for searching for nearby places, as well as for
@@ -56,6 +63,7 @@ typedef void (^FBSDKCurrentPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Null
for your app, see:
https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html.
*/
NS_SWIFT_NAME(PlacesManager)
@interface FBSDKPlacesManager : NSObject
@@ -79,16 +87,17 @@ typedef void (^FBSDKCurrentPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Null
@param cursor A pagination cursor.
@param completion An `FBSDKPlaceGraphRequestCompletion` block. Note that this block will
@param completion An `FBSDKPlaceGraphRequestBlock` block. Note that this block will
return the location, which you can choose to cache and use on calls to the synchronous
`placesGraphRequestForLocation` method.
*/
- (void)generatePlaceSearchRequestForSearchTerm:(nullable NSString *)searchTerm
categories:(nullable NSArray<NSString *> *)categories
fields:(nullable NSArray<NSString *> *)fields
categories:(NSArray<FBSDKPlacesCategoryKey> *)categories
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
distance:(CLLocationDistance)distance
cursor:(nullable NSString *)cursor
completion:(nonnull FBSDKPlaceGraphRequestCompletion)completion;
completion:(FBSDKPlaceGraphRequestBlock)completion
NS_SWIFT_NAME(generatePlaceSearchRequest(for:categories:fields:distance:cursor:completion:));
/**
Method for generating a graph request for searching the Places API.
@@ -115,8 +124,8 @@ typedef void (^FBSDKCurrentPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Null
*/
- (nullable FBSDKGraphRequest *)placeSearchRequestForLocation:(nullable CLLocation *)location
searchTerm:(nullable NSString *)searchTerm
categories:(nullable NSArray<NSString *> *)categories
fields:(nullable NSArray<NSString *> *)fields
categories:(NSArray<FBSDKPlacesCategoryKey> *)categories
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
distance:(CLLocationDistance)distance
cursor:(nullable NSString *)cursor;
@@ -132,11 +141,12 @@ typedef void (^FBSDKCurrentPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Null
`FBSDKPlacesKitConstants.h` for the fields exposed by the SDK, and see https://developers.facebook.com/docs/places/fields
for the most up to date list.
@param completion A `FBSDKCurrentPlaceGraphRequestCompletion` block, that contains the graph request.
@param completion A `FBSDKCurrentPlaceGraphRequestBlock` block, that contains the graph request.
*/
- (void)generateCurrentPlaceRequestWithMinimumConfidenceLevel:(FBSDKPlaceLocationConfidence)minimumConfidence
fields:(nullable NSArray<NSString *> *)fields
completion:(nonnull FBSDKCurrentPlaceGraphRequestCompletion)completion;
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
completion:(FBSDKCurrentPlaceGraphRequestBlock)completion
NS_SWIFT_NAME(generateCurrentPlaceRequest(confidence:fields:completion:));
/**
Method for generating a graph request to query for places the device is likely
@@ -155,12 +165,13 @@ typedef void (^FBSDKCurrentPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Null
`FBSDKPlacesKitConstants.h` for the fields exposed by the SDK, and see https://developers.facebook.com/docs/places/fields
for the most up to date list.
@param completion A `FBSDKCurrentPlaceGraphRequestCompletion` block, that contains the graph request.
@param completion A `FBSDKCurrentPlaceGraphRequestBlock` block, that contains the graph request.
*/
- (void)generateCurrentPlaceRequestForCurrentLocation:(nonnull CLLocation *)currentLocation
- (void)generateCurrentPlaceRequestForCurrentLocation:(CLLocation *)currentLocation
withMinimumConfidenceLevel:(FBSDKPlaceLocationConfidence)minimumConfidence
fields:(nullable NSArray<NSString *> *)fields
completion:(nonnull FBSDKCurrentPlaceGraphRequestCompletion)completion;
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
completion:(FBSDKCurrentPlaceGraphRequestBlock)completion
NS_SWIFT_NAME(generateCurrentPlaceRequest(for:confidence:fields:completion:));
/**
Method for generating a graph request to provide feedback to the Places Graph about
@@ -177,9 +188,10 @@ typedef void (^FBSDKCurrentPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Null
@return An `FBSDKGraphRequest` for the given parameters.
*/
- (nonnull FBSDKGraphRequest *)currentPlaceFeedbackRequestForPlaceID:(nonnull NSString *)placeID
tracking:(nonnull NSString *)tracking
wasHere:(BOOL)wasHere;
- (FBSDKGraphRequest *)currentPlaceFeedbackRequestForPlaceID:(NSString *)placeID
tracking:(NSString *)tracking
wasHere:(BOOL)wasHere
NS_SWIFT_NAME(currentPlaceFeedbackRequest(for:tracking:wasHere:));
/**
Method for generating a graph request to fetch additional information for a given place.
@@ -192,8 +204,11 @@ typedef void (^FBSDKCurrentPlaceGraphRequestCompletion)(FBSDKGraphRequest *_Null
@return An `FBSDKGraphRequest` for the given parameters.
*/
- (nonnull FBSDKGraphRequest *)placeInfoRequestForPlaceID:(nonnull NSString *)placeID
fields:(nullable NSArray<NSString *> *)fields;
- (FBSDKGraphRequest *)placeInfoRequestForPlaceID:(NSString *)placeID
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
NS_SWIFT_NAME(currentPlaceFeedbackRequest(for:fields:));
@end
NS_ASSUME_NONNULL_END
@@ -29,7 +29,7 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
@interface FBSDKPlacesManager() <CLLocationManagerDelegate>
@property (nonatomic, strong) CLLocationManager *locationManager;
@property (atomic, strong) NSMutableArray <FBSDKLocationRequestCompletion> *locationCompletionBlocks;
@property (atomic, strong) NSMutableArray<FBSDKLocationRequestCompletion> *locationCompletionBlocks;
@property (nonatomic, strong) FBSDKPlacesBluetoothScanner *bluetoothScanner;
@@ -52,11 +52,11 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
#pragma mark - Place Search
- (void)generatePlaceSearchRequestForSearchTerm:(NSString *)searchTerm
categories:(NSArray<NSString *> *)categories
fields:(NSArray<NSString *> *)fields
categories:(NSArray<FBSDKPlacesCategoryKey> *)categories
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
distance:(CLLocationDistance)distance
cursor:(NSString *)cursor
completion:(FBSDKPlaceGraphRequestCompletion)completion
completion:(FBSDKPlaceGraphRequestBlock)completion
{
__weak FBSDKPlacesManager *weakSelf = self;
[self.locationCompletionBlocks addObject:^void (CLLocation *location, NSError *error) {
@@ -69,13 +69,17 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
}
}];
[self.locationManager requestLocation];
if (@available(iOS 9.0, *)) {
[self.locationManager requestLocation];
} else {
[self.locationManager startUpdatingLocation];
}
}
- (FBSDKGraphRequest *)placeSearchRequestForLocation:(CLLocation *)location
searchTerm:(NSString *)searchTerm
categories:(NSArray<NSString *> *)categories
fields:(NSArray<NSString *> *)fields
categories:(NSArray<FBSDKPlacesCategoryKey> *)categories
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
distance:(CLLocationDistance)distance
cursor:(NSString *)cursor
{
@@ -88,7 +92,7 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
if (searchTerm) {
parameters[@"q"] = searchTerm;
}
if (categories) {
if (categories && categories.count > 0) {
parameters[@"categories"] = [self _jsonStringForObject:categories];
}
if (location) {
@@ -97,7 +101,7 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
if (distance > 0) {
parameters[@"distance"] = @(distance);
}
if (fields) {
if (fields && fields.count > 0) {
parameters[ParameterKeyFields] = [fields componentsJoinedByString:@","];
}
@@ -106,12 +110,12 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
parameters:parameters
tokenString:self._tokenString
version:nil
HTTPMethod:nil];
HTTPMethod:@""];
}
- (void)generateCurrentPlaceRequestWithMinimumConfidenceLevel:(FBSDKPlaceLocationConfidence)minimumConfidence
fields:(NSArray<NSString *> *)fields
completion:(FBSDKCurrentPlaceGraphRequestCompletion)completion
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
completion:(FBSDKCurrentPlaceGraphRequestBlock)completion
{
dispatch_group_t locationAndBeaconsGroup = dispatch_group_create();
@@ -128,10 +132,14 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
dispatch_group_leave(locationAndBeaconsGroup);
}];
[self.locationManager requestLocation];
if (@available(iOS 9.0, *)) {
[self.locationManager requestLocation];
} else {
[self.locationManager startUpdatingLocation];
}
dispatch_group_enter(locationAndBeaconsGroup);
[self.bluetoothScanner scanForBeaconsWithCompletion:^(NSArray<FBSDKBluetoothBeacon *> * _Nullable beacons) {
[self.bluetoothScanner scanForBeaconsWithCompletion:^(NSArray<FBSDKBluetoothBeacon *> *beacons) {
currentBeacons = beacons;
dispatch_group_leave(locationAndBeaconsGroup);
}];
@@ -148,10 +156,10 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
- (void)generateCurrentPlaceRequestForCurrentLocation:(CLLocation *)currentLocation
withMinimumConfidenceLevel:(FBSDKPlaceLocationConfidence)minimumConfidence
fields:(nullable NSArray<NSString *> *)fields
completion:(nonnull FBSDKCurrentPlaceGraphRequestCompletion)completion
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
completion:(nonnull FBSDKCurrentPlaceGraphRequestBlock)completion
{
[self.bluetoothScanner scanForBeaconsWithCompletion:^(NSArray<FBSDKBluetoothBeacon *> * _Nullable beacons) {
[self.bluetoothScanner scanForBeaconsWithCompletion:^(NSArray<FBSDKBluetoothBeacon *> *beacons) {
completion([self _currentPlaceGraphRequestForLocation:currentLocation bluetoothBeacons:beacons minimumConfidenceLevel:minimumConfidence fields:fields], nil);
}];
}
@@ -172,10 +180,10 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
}
- (FBSDKGraphRequest *)placeInfoRequestForPlaceID:(NSString *)placeID
fields:(NSArray<NSString *> *)fields
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
{
NSDictionary *parameters = @{};
if (fields) {
if (fields && fields.count) {
parameters = @{ParameterKeyFields : [fields componentsJoinedByString:@","]};
}
@@ -184,7 +192,7 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
parameters:parameters
tokenString:self._tokenString
version:nil
HTTPMethod:nil];
HTTPMethod:@""];
}
#pragma mark - Helper Methods
@@ -192,7 +200,7 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
- (FBSDKGraphRequest *)_currentPlaceGraphRequestForLocation:(CLLocation *)location
bluetoothBeacons:(NSArray<FBSDKBluetoothBeacon *> *)beacons
minimumConfidenceLevel:(FBSDKPlaceLocationConfidence)minimumConfidence
fields:(NSArray<NSString *> *)fields
fields:(NSArray<FBSDKPlacesFieldKey> *)fields
{
NSMutableDictionary *parameters = [NSMutableDictionary new];
@@ -223,7 +231,7 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
parameters[@"min_confidence_level"] = [self _confidenceWebKeyForConfidence:minimumConfidence];
}
if (fields) {
if (fields && fields.count > 0) {
parameters[ParameterKeyFields] = [fields componentsJoinedByString:@","];
}
@@ -232,7 +240,7 @@ typedef void (^FBSDKLocationRequestCompletion)(CLLocation *_Nullable location, N
parameters:parameters
tokenString:self._tokenString
version:nil
HTTPMethod:nil];
HTTPMethod:@""];
}
@@ -18,17 +18,24 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(BluetoothBeacon)
@interface FBSDKBluetoothBeacon : NSObject
@property (nonatomic, strong) NSNumber *_Nonnull RSSI;
@property (nonatomic, copy) NSString *_Nonnull payload;
@property (nonatomic, strong) NSNumber *RSSI;
@property (nonatomic, copy) NSString *payload;
@end
typedef void (^BluetoothBeaconScanCompletion)(NSArray<FBSDKBluetoothBeacon *> *_Nullable beacons);
typedef void (^FBSDKBluetoothBeaconBlock)(NSArray<FBSDKBluetoothBeacon *> *beacons)
NS_SWIFT_NAME(BluetoothBeaconBlock);
NS_SWIFT_NAME(PlacesBluetoothScanner)
@interface FBSDKPlacesBluetoothScanner : NSObject
- (void)scanForBeaconsWithCompletion:(nonnull BluetoothBeaconScanCompletion)completion;
- (void)scanForBeaconsWithCompletion:(FBSDKBluetoothBeaconBlock)completion;
@end
NS_ASSUME_NONNULL_END
@@ -33,7 +33,7 @@ static NSTimeInterval const scanLength = 0.5;
@property (nonatomic, strong) CBCentralManager *manager;
@property (nonatomic, strong) NSTimer *updateTimeoutTimer;
@property (nonatomic, strong) NSMutableArray<FBSDKBluetoothBeacon *> *discoveredBeacons;
@property (atomic, strong) NSMutableArray<BluetoothBeaconScanCompletion> *scanCompletionBlocks;
@property (atomic, strong) NSMutableArray<FBSDKBluetoothBeaconBlock> *scanCompletionBlocks;
@property (nonatomic, assign) BOOL didPerformScan;
@property (nonatomic, copy, readonly) NSArray<CBUUID *> *bluetoothServices;
@@ -56,13 +56,13 @@ static NSTimeInterval const scanLength = 0.5;
return self;
}
- (void)scanForBeaconsWithCompletion:(BluetoothBeaconScanCompletion)completion
- (void)scanForBeaconsWithCompletion:(FBSDKBluetoothBeaconBlock)completion
{
if (self.manager.state == CBCentralManagerStatePoweredOff ||
self.manager.state == CBCentralManagerStateUnsupported ||
self.manager.state == CBCentralManagerStateUnauthorized) {
completion(nil);
completion(@[]);
return;
}
@@ -94,12 +94,12 @@ static NSTimeInterval const scanLength = 0.5;
{
[self.manager stopScan];
for (BluetoothBeaconScanCompletion completion in self.scanCompletionBlocks) {
for (FBSDKBluetoothBeaconBlock completion in self.scanCompletionBlocks) {
if (self.didPerformScan) {
completion(self.discoveredBeacons);
}
else {
completion(nil);
completion(@[]);
}
}
[self.scanCompletionBlocks removeAllObjects];