ボタンをクリックするとuberボタンを作成しようとしましたが、私が望むのは、dropoffの場所を持つuberアプリケーションを開いていることです。私のアプリケーションとUberを統合する
私はすでにAPI(https://github.com/uber/rides-ios-sdk)を読んでいますが、私はそれが言うことを正確に行いましたが、私がuberボタンを押すと、すべてのドロップオフロケーションなしでオープンuberアプリです。
CLLocation *loc = [[CLLocation alloc]initWithLatitude:26.410640 longitude:50.099568];
UBSDKRideRequestButton *button = [[UBSDKRideRequestButton alloc] init];
UBSDKRidesClient *ridesClient = [[UBSDKRidesClient alloc] init];
CLLocation *pickupLocation = [[CLLocation alloc] initWithLatitude: self.locationManager.location.coordinate.latitude longitude: self.locationManager.location.coordinate.longitude];
CLLocation *dropoffLocation = [[CLLocation alloc] initWithLatitude: loc.coordinate.latitude longitude: loc.coordinate.longitude];
__block UBSDKRideParametersBuilder *builder = [[UBSDKRideParametersBuilder alloc] init];
builder = [builder setPickupLocation: pickupLocation];
builder = [builder setDropoffLocation: dropoffLocation];
[ridesClient fetchCheapestProductWithPickupLocation: dropoffLocation completion:^(UBSDKUberProduct* _Nullable product, UBSDKResponse* _Nullable response) {
if (product) {
builder = [builder setProductID: product.productID];
button.rideParameters = [builder build];
[button loadRideInformation];
}
}];
[self.view addSubview:button];
これは原因ではない可能性がありますが、dropoffLocationとpickupLocation @ '' fetchCheapestProductWithPickupLocation'を混在させているようです。場所の混在により、ボタンの時間と価格の見積もりが正しくないはずです。 – agraebe
開発者サイト –