This is possible through the following code. Because you will get the package ID of the application in which you are using your custom keyboard.
Swift
let hostBundleID = self.parentViewController!.valueForKey("_hostBundleID") let currentHostBundleID = String(hostBundleID) print(currentHostBundleID);
From the package identifier, you can easily find the name of the application.
Good luck
source share