#StackBounty: #ios #iphone #in-app-purchase #subscription How "Subscription Status Url" works for apple In-app purchases (Aut…

Bounty: 100

Does anybody work on “Subscription Status Url” and how it works for Auto Renewable In-app purchases in the sandbox mode

When i am trying to achive it, i am able to subscribe my product from App but while checking subscription status in the backend (server) we are not getting any “statusUpdateNotifications” from Apple Server. We have tested our URL and it is as per Apple security norms.

We went through below link but didn’t get much information

Working with Subscriptions


Get this bounty!!!

#StackBounty: #ios #google-maps #pointers Set a Pointer Address in Objective-C to nil

Bounty: 50

enter image description here

In my method polylines are drawn everytime the map markers are moved.
According to the Google Maps iOS documentation setting the polyline to nil will remove the polyline.

When I do that after the marker movement fires the polylines remain.

According to other posts on here the GMSPolyline can only be removed if you have the pointer address of the line you want to remove, because even declared globally the api still creates another instance everytime.

I don’t know much about pointers or addresses. How does one get the pointer address and once you do how do you reference the object by that address once you get it?

I can get the address like this:

NSString *addressRight = [NSString stringWithFormat:@"%p",polylineRightPreview];

Everytime the method is called even though the variable is declared globally I get a different address each time for GMSPolyline:

0x600000d36f80   0x620000d2dfc0    0x608001538560

I basically need this:

GMSPolyline *polyline = nil;

but it has to reference the exact pointer address of the last one created. How do you set

0x600000d36f80 to nil?

If you just call polyline = nil nothing will happen because once it has been added to the map it has it’s own pointer address. Also, calling the map clear function isn’t useful because it wouldn’t be appropriate to remove all the other map objects and redraw them.


Get this bounty!!!

#StackBounty: #ios #xcode #localization #localizable.strings Xcode Localizable.string multiple targets issue

Bounty: 50

I have a project with multiple targets, which represent the same app just with different styling and translations.

Since almost whole project looks the same for each target, I need to have just few strings in Localizable.strings file, that I need to be different. And I don’t want to copy whole huge Localizable.strings file to each project just because of the fact it has few lines different.

It is required for me to have just 1 strings file because of third-party libraries/SDK that are included in project. So I cannot use tableName for localizedString.

The problem is – I need to have a flexible possibility to override just few lines from Localizable.strings for each target separately. And I don’t like the idea just to copy whole file to each target, cause it will lead to annoying flow in the future, in case I will have 10 targets and I need to add 1 string to all of them.

The goal is to have 1 huge Localizable.strings file with all strings included, that would be common for all targets, and have small configuration for each target for the strings that should tell different. So target’s file should kinda merge and override the one that is common.

AFAIK it is not natively supported by Xcode, so I’m probably looking for a script that would make it works.

So, script should look into common and target’s Localizable files, merge them, and in case some keys are defined in both, then it should use the one from target’s file.

Can anyone help me with such script?


P.S. Similar issue exists with .xcassets, and CocoaPods solves it by merging multiple assets into 1, and it works as expected – if some targets has an asset containing the image with the same name that is already included into a common asset, then the one from target will replace it.

P.S.2. Similar feature is natively supported for Android devs – each image, each translations can be overridden by “child” flawor, or whatever it is called 🙂


Get this bounty!!!

#StackBounty: #ios #swift #ios11 #swift4 Adjust position of bar button item when using large titles with iOS 11

Bounty: 50

I am using the large title navbar with iOS 11, but when I add a bar button item it looks weird positioned in the same location as the original title navbar. I would like to move the bar button item down when the title is large, and move it back into its original position when the navbar is no longer large. What would be the best way of doing this?

This is an image showing the weird position of the bar button item

largeTitleNavbar

I can get the navbar height dynamically using the viewWillLayoutSubviews(), but I can’t change the position of the bar button item using setTitlePositionAdjustment

override func viewWillLayoutSubviews() {
    guard let navbarHeight = self.navigationController?.navigationBar.frame.height else{ return }
}


Get this bounty!!!

#StackBounty: #android #ios #xamarin #webview #xamarin.forms Show Prompt to know the location

Bounty: 100

I am using Xamarin WebView controller to display a web site (in both iOS/Android). The web site’s home page prompts to access the device location. But that prompt is not showing when I have this website on a WebView (from the App). When I open this site on the browser, from the same mobile device it shows the message box. I am just wondering if it is possible to have such prompts on Xamarin WebView?

Here is an example prompt.

enter image description here

This is all I have in the Xamarin app.

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:nCollar"
             x:Class="nCollar.MainPage">
    <ContentPage.Padding>
        <OnPlatform x:TypeArguments="Thickness">
            <OnPlatform.iOS>0,20,0,0</OnPlatform.iOS>
            <OnPlatform.Android>0,0,0,0</OnPlatform.Android>
            <OnPlatform.WinPhone>0,0,0,0</OnPlatform.WinPhone>
        </OnPlatform>
    </ContentPage.Padding>

    <WebView x:Name="webView"
                 Grid.Row="0"
                 VerticalOptions="FillAndExpand" 
                 Source="https://www.ncollar.com.au/"/>

</ContentPage>

UPDATE 1

Android

I’ve tried the solution mentioned in this post, but still it doesn’t show the prompt.

WebViewRenderer.cs

using Android.Webkit;
using Xamarin.Forms.Platform.Android;

[assembly: Xamarin.Forms.ExportRenderer(typeof(TestApp.Controls.WebView), typeof(TestApp.Droid.Renderers.WebViewRenderer))]
namespace TestApp.Droid.Renderers
{
    public class WebViewRenderer : Xamarin.Forms.Platform.Android.WebViewRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.WebView> e)
        {
            base.OnElementChanged(e);

            if (this.Control == null)
            {
                return;
            }

            var webView = this.Element as TestApp.Controls.WebView;
            if (webView == null)
            {
                return;
            }


           // webView. ings.JavaScriptEnabled = true;
            this.Control.Settings.DomStorageEnabled = true;
            this.Control.Settings.DisplayZoomControls = true;
            this.Control.Settings.BuiltInZoomControls = true;
            this.Control.Settings.SetGeolocationEnabled(true);
            this.Control.Settings.JavaScriptCanOpenWindowsAutomatically = true;

            this.Control.SetWebViewClient(new GeoWebViewClient());
            this.Control.SetWebChromeClient(new GeoWebChromeClient());
        }
    }

    public class GeoWebChromeClient : WebChromeClient
    {
        public override void OnGeolocationPermissionsShowPrompt(string origin, GeolocationPermissions.ICallback callback)
        {
            callback.Invoke(origin, true, false);
        }
    }

    public class GeoWebViewClient : WebViewClient
    {
        public override bool ShouldOverrideUrlLoading(WebView view, string url)
        {
            view.LoadUrl(url);
            return true;
        }
    }
}

Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-sdk android:minSdkVersion="15" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <application android:label="TestApp.Android"></application>
</manifest>

iOS

Tried NSLocationWhenInUseUsageDescription in the plist file, but no difference.


Get this bounty!!!

#StackBounty: #ios #excel #ms-office Integrate with Office from iOS applications

Bounty: 150

We want our app to be able to open an Excel document in the Excel app for editing and then be able to come back and see the changes when sent back to our application.

I have not been able to get it to work with OneDrive or SharePoint links although it says that this is possible on this page:

https://msdn.microsoft.com/en-us/library/office/dn911482.aspx

Did I misunderstand this somehow?


Get this bounty!!!

#StackBounty: #ios #swift #t9 How to implement smart searching of contacts by name and number by T9 in iOS?

Bounty: 100

I am working on a contacts app and I was wondering if it’s possible to search contacts like T9 dealers do (letters associated with each number also filters results). So if I press 2 key, it should search for number ‘2’ as well as ‘ABC’.

Code I am trying :

let enteredChar = dialerTextField.text!

        var pattern = keysDictionary?[enteredChar.last]

        pattern = "[(String(describing: pattern!.first)) - (String(describing: pattern!.last))]"
        // pattern = "[m-o]" Regex
        do {

            let matches = items.filter({

                (item : String) -> Bool in

                let stringMatch = item.range(of: pattern!, options: .regularExpression, range: nil, locale: nil)

                return stringMatch != nil ? true : false

            })

            let predicate = CNContact.predicateForContacts(matchingName: pattern!)

            let keys = [CNContactGivenNameKey, CNContactFamilyNameKey, CNContactEmailAddressesKey, CNContactPhoneNumbersKey, CNContactImageDataKey, CNContactImageDataAvailableKey]

            var contacts = [CNContact]()
            var message: String!

            let contactsStore = CNContactStore()

            do {
                contacts = try contactsStore.unifiedContacts(matching: predicate, keysToFetch: keys as [CNKeyDescriptor])

                if contacts.count == 0 {
                    message = "No contacts were found matching the given name."
                }
            }
            catch {
                message = "Unable to fetch contacts."
            }


            print("matches : ", contacts)
        }
        catch {

        }

using above code I can search for contact name if I change pattern to say “Rob” but it does not work with Regex "[p-s]". I’d like to search with regex. How can this be done? Thank you.


Get this bounty!!!

#StackBounty: #ios #ios9 #dyld Too many commands? Dyld Message: malformed mach-o: load commands size

Bounty: 50

Some iOS 9 devices in the wild seem to crash with the error message that I receive from the very basic crash reporting in Xcode only

dyld: malformed mach-o: load commands size (16464) > 16384

Unfortunately that’s all the info I get. I can’t even debug or reproduce locally.
Can anyone hint me into the right direction here?

It occurs after updating my Cocoapods, so I guess there’s one of them (or their dependency) that misbehaves.

After some investigation of my mach-O binary, I saw that the sizeofcmds is really 16464.
If I understand correctly, there seems to be a load command size limit of 16384, can anyone confirm this?

Does that mean I should remove dylibs and everything should be fine?


Get this bounty!!!

#StackBounty: #ios #nsurlconnection #httpurlconnection #nsurlconnectiondelegate #j2objc NSUrlConnection synchronous request without fol…

Bounty: 50

Problem

I need to execute a synchronous HTTP request, without following redirects, preferably without using instance variables, since this is to be incorporated into the j2objc project.

What have I tried

I have tried using NSURLConnection sendSynchronousRequest, which unfortunately cannot easily be told not to follow redirects.

Background

Before telling me that I should not use synchronous requests, please bear in mind that this code is for emulating Java’s HttpUrlConnection, which is inherently synchronous in behavior, for the j2objc project. The implementation of IosHttpUrlConnections‘ native makeSynchronousRequest currently always follows redirects. It should respect the HttpUrlConnection.instanceFollowRedirects field.

Further research conducted

  • When using NSUrlConnection in asynchronous mode, a delegate method is called, which allows for enabling/disabling redirects. However, I need synchronous operation.
  • This answer on NSUrlconnection: How to wait for completion shows how to implement sendSynchronousRequest using an async request. However, I haven’t been able to modify it to use a delegate, and thus haven’t been able to not follow redirects.

I hope you can help me


Get this bounty!!!

#StackBounty: #android #privacy #ios #chromecast #privacy-protection How to set up a Chromecast without logging in to Google Home?

Bounty: 50

I have a Chromecast audio and the Google Home app now requires location access and for you to log in. I don’t want to give it either, and therefore it does not help me set up the device. There is no way to bypass the requirements, unlike previous versions.

I can’t think of a reason to require both of them, save to send back to Google HQ for analysis.

Is there some other method I can use to set up the Chromecast?

This isn’t an android or iOS specific question, but those are the usual platforms to use the chromecast, followed up by the PC. If this doesn’t fit SuperUser, I can move it.


Get this bounty!!!