PureWeb 4.1 Upgrade Notes

Applications made using the 4.0.x version of the PureWeb SDK will require modifications to upgrade them to the current 4.1 release. These Upgrade Notes will help you identify the specific changes.

Change to the iOS APIs

Changes to the iOS APIs were required in order to support the iOS 7 operating system.

Specifically, it was necessary to refactor how certain HTTP requests are exchanged between the client and the PureWeb server, in order to more cleanly separate the request itself from the result of the call.

retrieveObject

The client-side retrieveObject function is used to retrieve an object which has been previously stored by the service application using the ResourceManager interface.

In previous releases, retrieveObject required to set a delegate and then access the request directly. In release 4.1, this function requires a completion block rather then a delegate. This block provides either the binary object or an error explaining why it could not be provided.

Below is an example of how to retrieve an object in 4.1; in this example, the interface is used to retrieve a screenshot.

[[PWFramework sharedInstance].client retrieveObject:resourceId onComplete:^(PWBinaryObject *screenShot, NSError *error) {
				
    if(!error) {
        //do something with the binary object
    }
}];

getSessionShareUrlAsync

The client-side getSessionShareUrlAsync function is used to request a share URL from the service-side CollaborationManager interface, which allows your client applications to take advantage of the collaboration feature.

In previous releases, getSessionShareUrlAsync required to set a delegate. In release 4.1, this function is block-based and provides either the requested shareURL, or an error explaining why it could not be provided.

Previous Release

[client getSessionShareUrlAsyncWithPassword:@"Scientific" shareDescriptor:@""shareTimeout:1800000 target:self

action:@selector(getSessionShareUrlAsyncDidFinish:)];
				
- (void)getSessionShareUrlAsyncDidFinish:(PWServiceRequestCompletedEventArgs*)args {

    if (args.request.status == PWServiceRequestStatusSuccess) {
        PWAppShare *appShare = (PWAppShare *)args.request;
        self.sharedURL = [appShare shareUrl];
    }
}

Current Release

        
[[PWFramework sharedInstance].client getSessionShareUrlAsyncWithPassword:@"Scientific"
				shareDescriptor:@""
				shareTimeout:1800000
				completion:^(NSURL *shareURL, NSError *error) {

    if (!error) {

    }
}];

invalidateSessionShareUrlAsync

The invalidateSessionShareUrlAsync is used to invalidate a share URL previous obtained using getSessionShareUrlAsync, and works in similar fashion.

When invalidating a given share URL, the completion block provides an error only if their is a problem with the invalidation of that URL.

Previous Release

[client invalidateSessionShareUrlAsync:self.sharedURL target:self

action:@selector(invalidateShareUrlDidFinish:)];

- (void)invalidateShareUrlDidFinish:(PWServiceRequestCompletedEventArgs *)args
{
    [self.shareButton setEnabled:YES forSegmentAtIndex:0];

    if (args.request.status == PWServiceRequestStatusSuccess)
    {
        self.sharedURL = nil;
    }
}

Current Release

[client invalidateSessionShareUrlAsync:self.sharedURL completion:^(NSError *error) {

    if (!error) {

    }
}];